summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-26 17:23:19 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-26 17:23:19 +0200
commitb59c6438a772e3c3aba2f455fa5482add6c9d886 (patch)
treea86a08c72ba12a38a3e660d827117ae197cf3603
parent508a713fd489749c8ee56d47f47a984b09aaf318 (diff)
downloadabrt-b59c6438a772e3c3aba2f455fa5482add6c9d886.tar.gz
abrt-b59c6438a772e3c3aba2f455fa5482add6c9d886.tar.xz
abrt-b59c6438a772e3c3aba2f455fa5482add6c9d886.zip
trivial: fix reversed logic in if (rename(path, newpath) != 0)...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--src/Hooks/abrt-hook-ccpp.cpp2
-rw-r--r--src/Hooks/abrt-hook-python.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Hooks/abrt-hook-ccpp.cpp b/src/Hooks/abrt-hook-ccpp.cpp
index aca64385..61277980 100644
--- a/src/Hooks/abrt-hook-ccpp.cpp
+++ b/src/Hooks/abrt-hook-ccpp.cpp
@@ -262,7 +262,7 @@ int main(int argc, char** argv)
*/
dd.Close();
char *newpath = xstrndup(path, path_len - (sizeof(".new")-1));
- if (rename(path, newpath) != 0)
+ if (rename(path, newpath) == 0)
strcpy(path, newpath);
free(newpath);
diff --git a/src/Hooks/abrt-hook-python.cpp b/src/Hooks/abrt-hook-python.cpp
index 27a02134..cbe1418e 100644
--- a/src/Hooks/abrt-hook-python.cpp
+++ b/src/Hooks/abrt-hook-python.cpp
@@ -145,7 +145,7 @@ int main(int argc, char** argv)
dd.Close();
char *newpath = xstrndup(path, path_len - (sizeof(".new")-1));
- if (rename(path, newpath) != 0)
+ if (rename(path, newpath) == 0)
strcpy(path, newpath);
free(newpath);