diff options
author | Diego Biurrun <diego@biurrun.de> | 2011-05-15 18:34:11 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2011-05-16 20:56:56 +0200 |
commit | d39facc783c270227e5b7c75db3dec406ed19018 (patch) | |
tree | e334782b9f76fc00d43bd3a266a9de64e61a4ad5 /tools/pktdumper.c | |
parent | bdefbf3e8857d2861d8d57c0ef583fe15a46d1a4 (diff) | |
download | ffmpeg-d39facc783c270227e5b7c75db3dec406ed19018.tar.gz |
tools: Check the return value of write().
This fixes several warnings of the type:
warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
Diffstat (limited to 'tools/pktdumper.c')
-rw-r--r-- | tools/pktdumper.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pktdumper.c b/tools/pktdumper.c index 3ab39ee675..80816d24b9 100644 --- a/tools/pktdumper.c +++ b/tools/pktdumper.c @@ -104,7 +104,11 @@ int main(int argc, char **argv) //printf("open(\"%s\")\n", pktfilename); if (!nowrite) { fd = open(pktfilename, O_WRONLY|O_CREAT, 0644); - write(fd, pkt.data, pkt.size); + err = write(fd, pkt.data, pkt.size); + if (err < 0) { + fprintf(stderr, "write: error %d\n", err); + return 1; + } close(fd); } av_free_packet(&pkt); |