[hackers] [sltar] Adding error catching to mknod || gottox

From: <hg_AT_suckless.org>
Date: Sun, 11 Nov 2012 17:23:49 +0100 (CET)

changeset: 22:18021ed2100c
user: gottox_AT_rootkit.lan
date: Thu Dec 27 19:35:50 2007 +0100
files: sltar.c
description:
Adding error catching to mknod


diff -r e680259c0c8f -r 18021ed2100c sltar.c
--- a/sltar.c Wed Dec 19 17:05:32 2007 +0100
+++ b/sltar.c Thu Dec 27 19:35:50 2007 +0100
_AT_@ -59,12 +59,14 @@
                                 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);
Received on Sun Nov 11 2012 - 17:23:49 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 11 2012 - 17:24:44 CET