diff options
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/split.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/split.c b/toys/posix/split.c index 0da8da6a..daf6422e 100644 --- a/toys/posix/split.c +++ b/toys/posix/split.c @@ -65,7 +65,7 @@ static void do_split(int infd, char *in) if (j) error_exit("bad suffix"); bytesleft = TT.b; linesleft = TT.l; - if (outfd != -1) close(outfd); + xclose(outfd); outfd = xcreate(TT.outfile, O_RDWR|O_CREAT|O_TRUNC, st.st_mode & 0777); } @@ -86,7 +86,7 @@ static void do_split(int infd, char *in) } if (CFG_TOYBOX_FREE) { - if (outfd != -1) close(outfd); + xclose(outfd); if (infd) close(infd); free(TT.outfile); } |