[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
[MD:1221]openp function with remote file.
- X-ml-count: 1221
- Subject: [MD:1221]openp function with remote file.
- From: Hiroya Tsubakimoto <zorac@xxxxxxxxxxxx>
- Date: Wed, 30 Jun 1999 21:28:03 +0900 (JST)
- X-mailer: cmail 2.59.13 on GNU Emacs 20.3.8.1 / Mule 4.0 (HANANOEN)
- User-agent: SEMI/1.13.2 (Mikawa) FLIM/1.12.5 (Hirahata) Emacs/20.3.8 (i386-*-nt4.10) MULE/4.0 (HANANOEN) Meadow/1.04 Alpha1 (TSUTSUJI)
# 妙なSubjectですが...。^_^;;
ソースを眺めていて気付いたのですが、Meadow-1.04a1でスクリプト
ファイルの為に実行ファイルを検出する際の処理が変更された点について、
openpのコメントには、
> If the file we find is remote, return 0
> but store the found remote file name in *STOREPTR.
> We do not check for remote files if EXEC_ONLY is nonzero. */
とありますので、return 0 の場合はcloseするのは不味いのではないでしょうか?
他の個所では0の場合はcloseしない様です。
# 実行ファイルがremoteということは無いとおもいますが念の為。
簡単ですがpatchも付けます。
patchにはw32.cの同様の部分も含んでます。
--
椿本 浩也 (Hiroya Tsubakimoto)
Office: <zorac@xxxxxxxxxxxx> 有限会社シセン堂
Home: <zorac@xxxxxxxxxxxxxxxxxxxxx>
--- callproc.c.orig Wed Jun 30 11:45:30 1999
+++ callproc.c Wed Jun 30 11:45:02 1999
@@ -399,7 +399,10 @@
#else
/* for script execution on MSWindows, not apply exec_only for openp */
/* openp without exec_only returns fd not used, free it immediately */
- close(openp (Vexec_path, args[0], EXEC_SUFFIXES, &path, 0));
+ {
+ int fd = openp (Vexec_path, args[0], EXEC_SUFFIXES, &path, 0);
+ if (fd > 0) close(fd);
+ }
#endif
UNGCPRO;
}
--- process.c.orig Wed Jun 30 11:33:46 1999
+++ process.c Wed Jun 30 11:34:58 1999
@@ -1167,7 +1167,10 @@
#else
/* for script execution on Windows, not apply exec_only for openp */
/* openp without exec_only returns fd not used, free it immediately */
- close(openp (Vexec_path, program, EXEC_SUFFIXES, &tem, 0));
+ {
+ int fd = openp (Vexec_path, program, EXEC_SUFFIXES, &tem, 0);
+ if (fd > 0) close(fd);
+ }
#endif
UNGCPRO;
if (NILP (tem))
--- w32.c.orig Wed Jun 30 11:38:02 1999
+++ w32.c Wed Jun 30 11:38:10 1999
@@ -3441,7 +3441,7 @@
#undef abort
abort ();
}
- else
+ else if (fd > 0)
{
close (fd);
}