version 1.12, 1999/05/24 17:57:19 |
version 1.13, 1999/11/30 16:41:41 |
|
|
#include "fsort.h" |
#include "fsort.h" |
#include "pathnames.h" |
#include "pathnames.h" |
|
|
|
#include <sys/types.h> |
|
#include <sys/stat.h> |
#include <paths.h> |
#include <paths.h> |
#include <signal.h> |
#include <signal.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
int sigtable[] = {SIGHUP, SIGINT, SIGPIPE, SIGXCPU, SIGXFSZ, |
int sigtable[] = {SIGHUP, SIGINT, SIGPIPE, SIGXCPU, SIGXFSZ, |
SIGVTALRM, SIGPROF, 0}; |
SIGVTALRM, SIGPROF, 0}; |
int outfd; |
int outfd; |
|
mode_t um; |
|
|
errno = 0; |
errno = 0; |
|
|
|
|
act.sa_handler = onsig; |
act.sa_handler = onsig; |
(void)snprintf(toutpath, sizeof(toutpath), "%sXXXXXXXXXX", |
(void)snprintf(toutpath, sizeof(toutpath), "%sXXXXXXXXXX", |
outpath); |
outpath); |
if ((outfd = mkstemp(toutpath)) < 0 || |
/* use default umask to try and avoid one syscall */ |
|
um = umask(S_IWGRP|S_IWOTH); |
|
if (um != S_IWGRP|S_IWOTH) |
|
(void)umask(um); |
|
if ((outfd = mkstemp(toutpath)) == -1 || |
|
fchmod(outfd, DEFFILEMODE & ~um) == -1 || |
(outfp = fdopen(outfd, "w")) == 0) |
(outfp = fdopen(outfd, "w")) == 0) |
err(2, toutpath); |
err(2, toutpath); |
outfile = toutpath; |
outfile = toutpath; |