version 1.1, 1997/01/20 19:39:55 |
version 1.2, 1997/01/22 06:53:16 |
|
|
argv[i] = devstdin; |
argv[i] = devstdin; |
} |
} |
} else if ((ch = access(argv[i], R_OK))) |
} else if ((ch = access(argv[i], R_OK))) |
err(2, "%s", argv[i]); |
err(2, argv[i]); |
} |
} |
if (!(fldtab->flags & (I|D) || fldtab[1].icol.num)) { |
if (!(fldtab->flags & (I|D) || fldtab[1].icol.num)) { |
SINGL_FLD = 1; |
SINGL_FLD = 1; |
|
|
int outfd; |
int outfd; |
errno = 0; |
errno = 0; |
if (access(outpath, W_OK)) |
if (access(outpath, W_OK)) |
err(2, "%s", outpath); |
err(2, outpath); |
act.sa_handler = onsig; |
act.sa_handler = onsig; |
(void)snprintf(toutpath, sizeof(toutpath), "%sXXXX", outpath); |
(void)snprintf(toutpath, sizeof(toutpath), "%sXXXX", outpath); |
if ((outfd = mkstemp(toutpath)) < 0 || |
if ((outfd = mkstemp(toutpath)) < 0 || |
|
|
fsort(-1, 0, filelist, argc-optind, outfp, fldtab); |
fsort(-1, 0, filelist, argc-optind, outfp, fldtab); |
if (outfile != outpath) { |
if (outfile != outpath) { |
if (access(outfile, 0)) |
if (access(outfile, 0)) |
err(2, "%s", outfile); |
err(2, outfile); |
(void)unlink(outpath); |
(void)unlink(outpath); |
if (link(outfile, outpath)) |
if (link(outfile, outpath)) |
err(2, "cannot link %s: output left in %s", |
err(2, "cannot link %s: output left in %s", |
|
|
{ |
{ |
if (msg) |
if (msg) |
(void)fprintf(stderr, "sort: %s\n", msg); |
(void)fprintf(stderr, "sort: %s\n", msg); |
(void)fprintf(stderr, "usage: [-o output] [-cmubdfinr] [-t char] "); |
(void)fprintf(stderr, "usage: [-T dir] [-o output] [-cmubdfinr] "); |
(void)fprintf(stderr, "[-T char] [-k keydef] ... [files]\n"); |
(void)fprintf(stderr, "[-t char] [-R char] [-k keydef] ... [files]\n"); |
exit(2); |
exit(2); |
} |
} |