| 39 |
|
#endif |
| 40 |
|
#endif |
| 41 |
|
/* protection from SYSV signals(!) */ |
| 42 |
< |
#if defined(sgi) || defined(hpux) |
| 42 |
> |
#if defined(sgi) |
| 43 |
|
#define guard_io() sighold(SIGALRM) |
| 44 |
|
#define unguard() sigrelse(SIGALRM) |
| 45 |
|
#endif |
| 148 |
|
case 'F': /* syncronization file */ |
| 149 |
|
if (argv[i][2]) |
| 150 |
|
break; |
| 151 |
< |
if ((syncfp = fopen(argv[++i],"r+")) == NULL) { |
| 151 |
> |
if ((syncfp = |
| 152 |
> |
fdopen(open(argv[++i],O_RDWR|O_CREAT,0666),"r+")) == NULL) { |
| 153 |
|
fprintf(stderr, "%s: cannot open\n", |
| 154 |
|
argv[i]); |
| 155 |
|
exit(1); |
| 187 |
|
int ltyp; |
| 188 |
|
{ |
| 189 |
|
static struct flock fls; /* static so initialized to zeroes */ |
| 190 |
+ |
extern char *sys_errlist[]; |
| 191 |
|
|
| 192 |
|
fls.l_type = ltyp; |
| 193 |
|
if (fcntl(fd, F_SETLKW, &fls) < 0) { |
| 194 |
< |
fprintf(stderr, "%s: cannot lock/unlock file\n", progname); |
| 194 |
> |
fprintf(stderr, "%s: cannot lock/unlock file: %s\n", |
| 195 |
> |
progname, sys_errlist[errno]); |
| 196 |
|
exit(1); |
| 197 |
|
} |
| 198 |
|
} |