diff options
author | Helge Deller <deller@gmx.de> | 2014-03-31 22:09:49 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2014-03-31 22:09:49 +0200 |
commit | 5c0722787704a46287d50be3c1ea2de594ef3ad6 (patch) | |
tree | 1888a5452b66fd10ca40e83008af8e828e0b486e | |
parent | 60213e5a693790f180b6ba003ff2a831b4e3fc38 (diff) | |
download | palo-5c0722787704a46287d50be3c1ea2de594ef3ad6.tar.gz |
Fix compiler warnings: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
-rw-r--r-- | palo/palo.c | 7 | ||||
-rw-r--r-- | palo/paloio.c | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/palo/palo.c b/palo/palo.c index d105692..553e009 100644 --- a/palo/palo.c +++ b/palo/palo.c @@ -490,8 +490,13 @@ do_formatted(int init, int media, const char *medianame, int partition, for (i = (holestart - f0start)/EXT2_BLOCKSIZE; i < (holestart - f0start)/EXT2_BLOCKSIZE + EXT2_HOLE; i++) { char buf[128]; + int len; sprintf(buf, "%d\n", i); - write(fd, buf, strlen(buf)); + len = strlen(buf); + if (len != write(fd, buf, len)) { + perror("Error writing badblock file"); + exit(1); + } } sprintf(cmd, "mke2fs %s -b %d -l %s %s", do_format == 3 ? "-j" : "", diff --git a/palo/paloio.c b/palo/paloio.c index 64e8e45..0e3dba1 100644 --- a/palo/paloio.c +++ b/palo/paloio.c @@ -121,7 +121,8 @@ cat(int out, int in) while ((n = read(in, buf, sizeof buf)) > 0) { - write(out, buf, n); + if (n != write(out, buf, n)) + perror("write in cat()"); total += n; } |