]> err.no Git - util-linux/commitdiff
libblkid: fix gcc warning (warn_unused_result)
authorKarel Zak <kzak@redhat.com>
Tue, 29 Sep 2009 11:48:16 +0000 (13:48 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Sep 2009 11:48:16 +0000 (13:48 +0200)
save.c: In function ‘blkid_flush_cache’:
save.c:146: warning: ignoring return value of ‘link’, declared with
attribute warn_unused_result

Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/save.c

index bbe6f488e26495b360633332bbca411034796269..c61373d508382f437eacf15740fa650ed91ce3bf 100644 (file)
@@ -143,7 +143,11 @@ int blkid_flush_cache(blkid_cache cache)
                        if (backup) {
                                sprintf(backup, "%s.old", filename);
                                unlink(backup);
-                               link(filename, backup);
+                               if (link(filename, backup)) {
+                                       DBG(DEBUG_SAVE,
+                                               printf("can't link %s to %s\n",
+                                                       filename, backup));
+                               }
                                free(backup);
                        }
                        rename(opened, filename);