245 |
#endif |
#endif |
246 |
|
|
247 |
if (*outname == 0) |
if (*outname == 0) |
248 |
fatal ("Destination file name is empty", 0); |
fatal ("Destination file name is empty", 0, 0); |
249 |
|
|
250 |
/* Check access to output file. */ |
/* Check access to output file. */ |
251 |
if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) |
if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0) |
601 |
/* Print error message and exit. */ |
/* Print error message and exit. */ |
602 |
|
|
603 |
void |
void |
604 |
fatal (s1, s2) |
fatal (s1, s2, s3) |
605 |
char *s1, *s2; |
char *s1, *s2, *s3; |
606 |
{ |
{ |
607 |
if (delete_lockname) |
if (delete_lockname) |
608 |
unlink (delete_lockname); |
unlink (delete_lockname); |
609 |
error (s1, s2, 0); |
error (s1, s2, s3); |
610 |
exit (EXIT_FAILURE); |
exit (EXIT_FAILURE); |
611 |
} |
} |
612 |
|
|
631 |
pfatal_with_name (name) |
pfatal_with_name (name) |
632 |
char *name; |
char *name; |
633 |
{ |
{ |
634 |
char *s = concat ("", strerror (errno), " for %s"); |
fatal ("%s for %s", strerror (errno), name); |
|
fatal (s, name); |
|
635 |
} |
} |
636 |
|
|
637 |
void |
void |
638 |
pfatal_and_delete (name) |
pfatal_and_delete (name) |
639 |
char *name; |
char *name; |
640 |
{ |
{ |
641 |
char *s = concat ("", strerror (errno), " for %s"); |
char *s = strerror (errno); |
642 |
unlink (name); |
unlink (name); |
643 |
fatal (s, name); |
fatal ("%s for %s", s, name); |
644 |
} |
} |
645 |
|
|
646 |
/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ |
/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ |
668 |
{ |
{ |
669 |
long *result = (long *) malloc (size); |
long *result = (long *) malloc (size); |
670 |
if (!result) |
if (!result) |
671 |
fatal ("virtual memory exhausted", 0); |
fatal ("virtual memory exhausted", 0, 0); |
672 |
return result; |
return result; |
673 |
} |
} |
674 |
|
|