sltar

a simple tar implementation
git clone git://git.suckless.org/sltar
Log | Files | Refs | LICENSE

commit 79fe633448883a144e3ded13cac19460802ea74b
parent cc12aa5fd38eab3668eb71cefb152aa7ed2b7d96
Author: gottox@rootkit.lan <unknown>
Date:   Thu, 27 Dec 2007 19:35:50 +0100

Adding error catching to mknod
Diffstat:
sltar.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sltar.c b/sltar.c @@ -59,12 +59,14 @@ int main(int argc, char *argv[]) { break; case '3': /* char device */ case '4': /* block device */ - mknod(fname, (b[TYPE] == '3' ? S_IFCHR : S_IFBLK) | strtoul(b + MODE,0,8), + if(mknod(fname, (b[TYPE] == '3' ? S_IFCHR : S_IFBLK) | strtoul(b + MODE,0,8), makedev(strtoul(b + MAJ,0,8), - strtoul(b + MIN,0,8))); + strtoul(b + MIN,0,8)))) + perror(fname); break; case '6': /* fifo */ - mknod(fname, S_IFIFO | strtoull(b + MODE,0,8), 0); + if(mknod(fname, S_IFIFO | strtoul(b + MODE,0,8), 0)) + perror(fname); break; default: fputs("not supported filetype\n",stderr);