diff options
author | Gedare Bloom <gedare@rtems.org> | 2013-09-05 14:10:52 -0400 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2013-09-05 14:10:52 -0400 |
commit | e075b388728408e8745408c8dbdbe9635ccea399 (patch) | |
tree | 351ffc05d9a839766bed74229d2b6979ada1c3d1 /cpukit | |
parent | dosfs: Eliminate empty case statements that fall through to default. (diff) | |
download | rtems-e075b388728408e8745408c8dbdbe9635ccea399.tar.bz2 |
untar: check return value from mkdir
Check the return value from mkdir instead of failing silently.
1063857 Unchecked return value from library
Diffstat (limited to '')
-rw-r--r-- | cpukit/libmisc/untar/untar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpukit/libmisc/untar/untar.c b/cpukit/libmisc/untar/untar.c index 9ed00e92a0..5f1699da07 100644 --- a/cpukit/libmisc/untar/untar.c +++ b/cpukit/libmisc/untar/untar.c @@ -223,7 +223,11 @@ Untar_FromMemory( } else if (linkflag == DIRTYPE) { - mkdir(fname, S_IRWXU | S_IRWXG | S_IRWXO); + if ( mkdir(fname, S_IRWXU | S_IRWXG | S_IRWXO) != 0 ) { + printk("Untar: failed to create directory %s\n", fname); + retval = UNTAR_FAIL; + break; + } } } |