Mercurial > hg > xemacs-beta
comparison src/callproc.c @ 251:677f6a0ee643 r20-5b24
Import from CVS: tag r20-5b24
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:19:59 +0200 |
parents | 1f0dabaa0855 |
children | 11cf20601dec |
comparison
equal
deleted
inserted
replaced
250:f385a461c9aa | 251:677f6a0ee643 |
---|---|
233 NGCPRO2 (current_dir, path); /* Caller gcprotects args[] */ | 233 NGCPRO2 (current_dir, path); /* Caller gcprotects args[] */ |
234 current_dir = current_buffer->directory; | 234 current_dir = current_buffer->directory; |
235 current_dir = Funhandled_file_name_directory (current_dir); | 235 current_dir = Funhandled_file_name_directory (current_dir); |
236 current_dir = expand_and_dir_to_file (current_dir, Qnil); | 236 current_dir = expand_and_dir_to_file (current_dir, Qnil); |
237 #if 0 | 237 #if 0 |
238 /* I don't know how RMS intends this crock of shit to work, but it | 238 /* reportedly causes problems with ange-ftp-visited-files */ |
239 breaks everything in the presence of ange-ftp-visited files, so | |
240 fuck it. */ | |
241 if (NILP (Ffile_accessible_directory_p (current_dir))) | 239 if (NILP (Ffile_accessible_directory_p (current_dir))) |
242 report_file_error ("Setting current directory", | 240 report_file_error ("Setting current directory", |
243 Fcons (current_buffer->directory, Qnil)); | 241 Fcons (current_buffer->directory, Qnil)); |
244 #endif /* 0 */ | 242 #endif /* 0 */ |
245 NUNGCPRO; | 243 NUNGCPRO; |
316 | 314 |
317 if (NILP (path)) | 315 if (NILP (path)) |
318 report_file_error ("Searching for program", Fcons (args[0], Qnil)); | 316 report_file_error ("Searching for program", Fcons (args[0], Qnil)); |
319 new_argv[0] = (char *) XSTRING_DATA (path); | 317 new_argv[0] = (char *) XSTRING_DATA (path); |
320 | 318 |
321 filefd = open ((char *) XSTRING_DATA (infile), O_RDONLY, 0); | 319 filefd = open ((char *) XSTRING_DATA (infile), O_RDONLY | OPEN_BINARY, 0); |
322 if (filefd < 0) | 320 if (filefd < 0) |
323 report_file_error ("Opening process input file", Fcons (infile, Qnil)); | 321 report_file_error ("Opening process input file", Fcons (infile, Qnil)); |
324 | 322 |
325 #ifdef MSDOS | 323 #ifdef MSDOS |
326 /* These vars record information from process termination. | 324 /* These vars record information from process termination. |
352 #endif /* MSDOS */ | 350 #endif /* MSDOS */ |
353 | 351 |
354 #ifndef MSDOS | 352 #ifndef MSDOS |
355 if (INTP (buffer)) | 353 if (INTP (buffer)) |
356 { | 354 { |
357 fd[1] = open (NULL_DEVICE, O_WRONLY, 0); | 355 fd[1] = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY, 0); |
358 fd[0] = -1; | 356 fd[0] = -1; |
359 } | 357 } |
360 else | 358 else |
361 { | 359 { |
362 pipe (fd); | 360 pipe (fd); |
438 close (filefd); | 436 close (filefd); |
439 report_file_error ("Cannot re-open temporary file", Qnil); | 437 report_file_error ("Cannot re-open temporary file", Qnil); |
440 } | 438 } |
441 #else /* not MSDOS */ | 439 #else /* not MSDOS */ |
442 if (NILP (error_file)) | 440 if (NILP (error_file)) |
443 fd_error = open (NULL_DEVICE, O_WRONLY); | 441 fd_error = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY); |
444 else if (STRINGP (error_file)) | 442 else if (STRINGP (error_file)) |
445 { | 443 { |
446 #ifdef DOS_NT | 444 #ifdef DOS_NT |
447 fd_error = open (XSTRING_DATA (error_file), | 445 fd_error = open (XSTRING_DATA (error_file), |
448 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, | 446 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, |
449 S_IREAD | S_IWRITE); | 447 S_IREAD | S_IWRITE); |
450 #else /* not DOS_NT */ | 448 #else /* not DOS_NT */ |
451 fd_error = | 449 fd_error = open (XSTRING_DATA (error_file), |
452 creat ((CONST char *) XSTRING_DATA (error_file), 0666); | 450 O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, |
451 CREAT_MODE); | |
453 #endif /* not DOS_NT */ | 452 #endif /* not DOS_NT */ |
454 } | 453 } |
455 | 454 |
456 if (fd_error < 0) | 455 if (fd_error < 0) |
457 { | 456 { |