Преглед изворни кода

libdpkg, dpkg-divert: Mark unimportant unlink() return code as unwanted

Make it explicit that we do not care about the return code of these
unlink() calls.

Warned-by: coverity
Guillem Jover пре 12 година
родитељ
комит
7d493c3ce4
3 измењених фајлова са 3 додато и 3 уклоњено
  1. 1 1
      lib/dpkg/cleanup.c
  2. 1 1
      lib/dpkg/dbmodify.c
  3. 1 1
      src/divertcmd.c

+ 1 - 1
lib/dpkg/cleanup.c

@@ -65,5 +65,5 @@ cu_filename(int argc, void **argv)
 {
 	const char *filename = argv[0];
 
-	unlink(filename);
+	(void)unlink(filename);
 }

+ 1 - 1
lib/dpkg/dbmodify.c

@@ -332,7 +332,7 @@ void modstatdb_shutdown(void) {
     modstatdb_checkpoint();
     /* Tidy up a bit, but don't worry too much about failure. */
     fclose(importanttmp);
-    unlink(importanttmpfile);
+    (void)unlink(importanttmpfile);
     varbuf_destroy(&uvb);
     /* Fall through. */
   case msdbrw_needsuperuserlockonly:

+ 1 - 1
src/divertcmd.c

@@ -165,7 +165,7 @@ check_writable_dir(struct file *f)
 	if (tmpfd < 0)
 		ohshite(_("error checking '%s'"), f->name);
 	close(tmpfd);
-	unlink(tmpname);
+	(void)unlink(tmpname);
 
 	free(tmpname);
 }