Changeset 2673 for trunk/emx/src/emxomf/emxomfld.c
- Timestamp:
- Mar 19, 2006, 6:21:22 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/emx/src/emxomf/emxomfld.c
r2300 r2673 349 349 if (response_file == NULL) 350 350 { 351 int fd; 351 352 352 353 /* Complain if we are not allowed to use a response … … 363 364 364 365 strcpy (response_fname, "ldXXXXXX"); 365 if (mktemp (response_fname) == NULL) 366 fd = mkstemp (response_fname); 367 if (fd < 0) 366 368 { 367 369 perror ("emxomfld"); 368 370 exit (2); 369 371 } 372 close(fd); 370 373 response_file = fopen (response_fname, "wt"); 371 374 if (response_file == NULL) … … 1161 1164 static void arg_init (int rsp) 1162 1165 { 1163 response_fname[0] = '\0'; 1166 if (response_fname[0] != '\0') 1167 { 1168 remove (response_fname); 1169 response_fname[0] = '\0'; 1170 } 1164 1171 command_line[0] = '\0'; 1165 1172 line_len = 0; … … 1496 1503 fprintf (stderr, 1497 1504 "emxomfld: multiple module definition files\n"); 1498 usage ();1505 return 1; 1499 1506 } 1500 1507 def_fname = _realrealpath(optarg, NULL, 0); … … 1512 1519 fprintf (stderr, 1513 1520 "emxomfld: multiple binary resource files\n"); 1514 usage ();1521 return 1; 1515 1522 } 1516 1523 res_fname = _realrealpath(optarg, NULL, 0); … … 1585 1592 { 1586 1593 fprintf (stderr, "emxomfld: multiple map files files\n"); 1587 usage ();1594 return 1; 1588 1595 } 1589 1596 map_fname = optarg; … … 1593 1600 case OPT_ZSTACK: 1594 1601 if (!optarg) 1595 usage ();1602 return 1; 1596 1603 errno = 0; 1597 1604 stack_size = strtol (optarg, &t, 0); 1598 1605 if (errno != 0 || *t != 0 || t == optarg) 1599 usage ();1606 return 1; 1600 1607 break; 1601 1608 … … 1622 1629 if (optind > 1) 1623 1630 fprintf (stderr, "emxomfld: invalid option (%s)\n", argv[optind - 1]); 1624 usage (); 1631 else 1632 usage (); 1633 return 1; 1625 1634 } 1626 1635 } … … 1639 1648 { 1640 1649 fprintf (stderr, "emxomfld: no input files\n"); 1641 usage ();1650 return 1; 1642 1651 } 1643 1652 … … 1656 1665 else if (map_fname == NULL) 1657 1666 { 1658 t = xstrdup (output_fname); 1667 int cch = strlen (output_fname) + 1; 1668 t = xmalloc (cch + 4); 1669 memcpy (t, output_fname, cch); 1659 1670 _remext (t); 1671 strcat (t, ".map"); 1660 1672 map_fname = t; 1661 1673 }
Note:
See TracChangeset
for help on using the changeset viewer.