235 |
|
if (fcntl(fd, F_SETLKW, &fls) < 0) { |
236 |
|
fprintf(stderr, "%s: cannot lock/unlock file: %s\n", |
237 |
|
progname, strerror(errno)); |
238 |
< |
exit(1); |
238 |
> |
_exit(1); |
239 |
|
} |
240 |
|
} |
241 |
|
|
573 |
|
/* lock file section so NFS doesn't mess up */ |
574 |
|
fls.l_whence = 0; |
575 |
|
fls.l_type = F_WRLCK; |
576 |
+ |
#if 0 |
577 |
|
if (fcntl(outfd, F_SETLKW, &fls) < 0) |
578 |
|
filerr("lock"); |
579 |
+ |
#else |
580 |
+ |
dolock(outfd, F_WRLCK); |
581 |
|
#endif |
582 |
+ |
#endif |
583 |
|
/* write new piece to file */ |
584 |
|
if (lseek(outfd, (off_t)fls.l_start, SEEK_SET) < 0) |
585 |
|
filerr("seek"); |
599 |
|
} |
600 |
|
#if NFS |
601 |
|
fls.l_type = F_UNLCK; /* release lock */ |
602 |
+ |
#if 0 |
603 |
|
if (fcntl(outfd, F_SETLKW, &fls) < 0) |
604 |
|
filerr("lock"); |
605 |
+ |
#else |
606 |
+ |
dolock(outfd, F_UNLCK); |
607 |
+ |
#endif |
608 |
|
#endif |
609 |
|
if (verbose) { /* notify caller */ |
610 |
|
printf("%d %d done\n", xpos, ypos); |