diff options
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/src/callproc.c b/src/callproc.c index cd06ad5c2e8..34748c71c1c 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -137,8 +137,7 @@ static int call_process_exited; | |||
| 137 | EXFUN (Fgetenv_internal, 2); | 137 | EXFUN (Fgetenv_internal, 2); |
| 138 | 138 | ||
| 139 | static Lisp_Object | 139 | static Lisp_Object |
| 140 | call_process_kill (fdpid) | 140 | call_process_kill (Lisp_Object fdpid) |
| 141 | Lisp_Object fdpid; | ||
| 142 | { | 141 | { |
| 143 | emacs_close (XFASTINT (Fcar (fdpid))); | 142 | emacs_close (XFASTINT (Fcar (fdpid))); |
| 144 | EMACS_KILLPG (XFASTINT (Fcdr (fdpid)), SIGKILL); | 143 | EMACS_KILLPG (XFASTINT (Fcdr (fdpid)), SIGKILL); |
| @@ -147,8 +146,7 @@ call_process_kill (fdpid) | |||
| 147 | } | 146 | } |
| 148 | 147 | ||
| 149 | Lisp_Object | 148 | Lisp_Object |
| 150 | call_process_cleanup (arg) | 149 | call_process_cleanup (Lisp_Object arg) |
| 151 | Lisp_Object arg; | ||
| 152 | { | 150 | { |
| 153 | Lisp_Object fdpid = Fcdr (arg); | 151 | Lisp_Object fdpid = Fcdr (arg); |
| 154 | #if defined (MSDOS) | 152 | #if defined (MSDOS) |
| @@ -848,8 +846,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 848 | } | 846 | } |
| 849 | 847 | ||
| 850 | static Lisp_Object | 848 | static Lisp_Object |
| 851 | delete_temp_file (name) | 849 | delete_temp_file (Lisp_Object name) |
| 852 | Lisp_Object name; | ||
| 853 | { | 850 | { |
| 854 | /* Suppress jka-compr handling, etc. */ | 851 | /* Suppress jka-compr handling, etc. */ |
| 855 | int count = SPECPDL_INDEX (); | 852 | int count = SPECPDL_INDEX (); |
| @@ -997,7 +994,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 997 | RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args))); | 994 | RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args))); |
| 998 | } | 995 | } |
| 999 | 996 | ||
| 1000 | static int relocate_fd (); | 997 | static int relocate_fd (int fd, int minfd); |
| 1001 | 998 | ||
| 1002 | static char ** | 999 | static char ** |
| 1003 | add_env (char **env, char **new_env, char *string) | 1000 | add_env (char **env, char **new_env, char *string) |
| @@ -1052,11 +1049,7 @@ add_env (char **env, char **new_env, char *string) | |||
| 1052 | executable directory by the parent. */ | 1049 | executable directory by the parent. */ |
| 1053 | 1050 | ||
| 1054 | int | 1051 | int |
| 1055 | child_setup (in, out, err, new_argv, set_pgrp, current_dir) | 1052 | child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir) |
| 1056 | int in, out, err; | ||
| 1057 | register char **new_argv; | ||
| 1058 | int set_pgrp; | ||
| 1059 | Lisp_Object current_dir; | ||
| 1060 | { | 1053 | { |
| 1061 | char **env; | 1054 | char **env; |
| 1062 | char *pwd_var; | 1055 | char *pwd_var; |
| @@ -1295,8 +1288,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1295 | /* Move the file descriptor FD so that its number is not less than MINFD. | 1288 | /* Move the file descriptor FD so that its number is not less than MINFD. |
| 1296 | If the file descriptor is moved at all, the original is freed. */ | 1289 | If the file descriptor is moved at all, the original is freed. */ |
| 1297 | static int | 1290 | static int |
| 1298 | relocate_fd (fd, minfd) | 1291 | relocate_fd (int fd, int minfd) |
| 1299 | int fd, minfd; | ||
| 1300 | { | 1292 | { |
| 1301 | if (fd >= minfd) | 1293 | if (fd >= minfd) |
| 1302 | return fd; | 1294 | return fd; |
| @@ -1322,12 +1314,7 @@ relocate_fd (fd, minfd) | |||
| 1322 | } | 1314 | } |
| 1323 | 1315 | ||
| 1324 | static int | 1316 | static int |
| 1325 | getenv_internal_1 (var, varlen, value, valuelen, env) | 1317 | getenv_internal_1 (char *var, int varlen, char **value, int *valuelen, Lisp_Object env) |
| 1326 | char *var; | ||
| 1327 | int varlen; | ||
| 1328 | char **value; | ||
| 1329 | int *valuelen; | ||
| 1330 | Lisp_Object env; | ||
| 1331 | { | 1318 | { |
| 1332 | for (; CONSP (env); env = XCDR (env)) | 1319 | for (; CONSP (env); env = XCDR (env)) |
| 1333 | { | 1320 | { |
| @@ -1361,12 +1348,7 @@ getenv_internal_1 (var, varlen, value, valuelen, env) | |||
| 1361 | } | 1348 | } |
| 1362 | 1349 | ||
| 1363 | static int | 1350 | static int |
| 1364 | getenv_internal (var, varlen, value, valuelen, frame) | 1351 | getenv_internal (char *var, int varlen, char **value, int *valuelen, Lisp_Object frame) |
| 1365 | char *var; | ||
| 1366 | int varlen; | ||
| 1367 | char **value; | ||
| 1368 | int *valuelen; | ||
| 1369 | Lisp_Object frame; | ||
| 1370 | { | 1352 | { |
| 1371 | /* Try to find VAR in Vprocess_environment first. */ | 1353 | /* Try to find VAR in Vprocess_environment first. */ |
| 1372 | if (getenv_internal_1 (var, varlen, value, valuelen, | 1354 | if (getenv_internal_1 (var, varlen, value, valuelen, |
| @@ -1428,8 +1410,7 @@ If optional parameter ENV is a list, then search this list instead of | |||
| 1428 | /* A version of getenv that consults the Lisp environment lists, | 1410 | /* A version of getenv that consults the Lisp environment lists, |
| 1429 | easily callable from C. */ | 1411 | easily callable from C. */ |
| 1430 | char * | 1412 | char * |
| 1431 | egetenv (var) | 1413 | egetenv (char *var) |
| 1432 | char *var; | ||
| 1433 | { | 1414 | { |
| 1434 | char *value; | 1415 | char *value; |
| 1435 | int valuelen; | 1416 | int valuelen; |
| @@ -1444,7 +1425,7 @@ egetenv (var) | |||
| 1444 | /* This is run before init_cmdargs. */ | 1425 | /* This is run before init_cmdargs. */ |
| 1445 | 1426 | ||
| 1446 | void | 1427 | void |
| 1447 | init_callproc_1 () | 1428 | init_callproc_1 (void) |
| 1448 | { | 1429 | { |
| 1449 | char *data_dir = egetenv ("EMACSDATA"); | 1430 | char *data_dir = egetenv ("EMACSDATA"); |
| 1450 | char *doc_dir = egetenv ("EMACSDOC"); | 1431 | char *doc_dir = egetenv ("EMACSDOC"); |
| @@ -1466,7 +1447,7 @@ init_callproc_1 () | |||
| 1466 | /* This is run after init_cmdargs, when Vinstallation_directory is valid. */ | 1447 | /* This is run after init_cmdargs, when Vinstallation_directory is valid. */ |
| 1467 | 1448 | ||
| 1468 | void | 1449 | void |
| 1469 | init_callproc () | 1450 | init_callproc (void) |
| 1470 | { | 1451 | { |
| 1471 | char *data_dir = egetenv ("EMACSDATA"); | 1452 | char *data_dir = egetenv ("EMACSDATA"); |
| 1472 | 1453 | ||
| @@ -1555,7 +1536,7 @@ init_callproc () | |||
| 1555 | } | 1536 | } |
| 1556 | 1537 | ||
| 1557 | void | 1538 | void |
| 1558 | set_initial_environment () | 1539 | set_initial_environment (void) |
| 1559 | { | 1540 | { |
| 1560 | register char **envp; | 1541 | register char **envp; |
| 1561 | #ifndef CANNOT_DUMP | 1542 | #ifndef CANNOT_DUMP |
| @@ -1575,7 +1556,7 @@ set_initial_environment () | |||
| 1575 | } | 1556 | } |
| 1576 | 1557 | ||
| 1577 | void | 1558 | void |
| 1578 | syms_of_callproc () | 1559 | syms_of_callproc (void) |
| 1579 | { | 1560 | { |
| 1580 | #ifdef DOS_NT | 1561 | #ifdef DOS_NT |
| 1581 | Qbuffer_file_type = intern ("buffer-file-type"); | 1562 | Qbuffer_file_type = intern ("buffer-file-type"); |