소스 검색

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];
 	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();
     modstatdb_checkpoint();
     /* Tidy up a bit, but don't worry too much about failure. */
     /* Tidy up a bit, but don't worry too much about failure. */
     fclose(importanttmp);
     fclose(importanttmp);
-    unlink(importanttmpfile);
+    (void)unlink(importanttmpfile);
     varbuf_destroy(&uvb);
     varbuf_destroy(&uvb);
     /* Fall through. */
     /* Fall through. */
   case msdbrw_needsuperuserlockonly:
   case msdbrw_needsuperuserlockonly:

+ 1 - 1
src/divertcmd.c

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