diff options
| author | Juanma Barranquero | 2008-09-22 15:21:40 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-09-22 15:21:40 +0000 |
| commit | 9d0a6e42058de55024e17ba40a8e9bb48c162db8 (patch) | |
| tree | c24ca195e94d2f5d398ab0bcd3efec683ed585ff /src | |
| parent | 9d29095c137170c8918feded7c28622d7472f7d7 (diff) | |
| download | emacs-9d0a6e42058de55024e17ba40a8e9bb48c162db8.tar.gz emacs-9d0a6e42058de55024e17ba40a8e9bb48c162db8.zip | |
* emacs.c (Fdaemonp): Doc fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/emacs.c | 18 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4039e582ebe..c53dd35e2d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | 2008-09-22 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * emacs.c (Fdaemonp): Doc fix. | ||
| 4 | |||
| 1 | 2008-09-22 Dan Nicolaescu <dann@ics.uci.edu> | 5 | 2008-09-22 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 6 | ||
| 3 | * emacs.c (main): Place #ifdef.in the proper place. | 7 | * emacs.c (main): Place #ifdef in the proper place. |
| 4 | 8 | ||
| 5 | 2008-09-21 Dan Nicolaescu <dann@ics.uci.edu> | 9 | 2008-09-21 Dan Nicolaescu <dann@ics.uci.edu> |
| 6 | 10 | ||
diff --git a/src/emacs.c b/src/emacs.c index af4a6924240..f94d2d39ae4 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1074,20 +1074,20 @@ main (int argc, char **argv) | |||
| 1074 | if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args)) | 1074 | if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args)) |
| 1075 | { | 1075 | { |
| 1076 | #ifndef DOS_NT | 1076 | #ifndef DOS_NT |
| 1077 | pid_t f = fork(); | 1077 | pid_t f = fork (); |
| 1078 | int nfd; | 1078 | int nfd; |
| 1079 | if (f > 0) | 1079 | if (f > 0) |
| 1080 | exit(0); | 1080 | exit (0); |
| 1081 | if (f < 0) | 1081 | if (f < 0) |
| 1082 | { | 1082 | { |
| 1083 | fprintf (stderr, "Cannot fork!\n"); | 1083 | fprintf (stderr, "Cannot fork!\n"); |
| 1084 | exit(1); | 1084 | exit (1); |
| 1085 | } | 1085 | } |
| 1086 | 1086 | ||
| 1087 | nfd = open("/dev/null", O_RDWR); | 1087 | nfd = open ("/dev/null", O_RDWR); |
| 1088 | dup2(nfd, 0); | 1088 | dup2 (nfd, 0); |
| 1089 | dup2(nfd, 1); | 1089 | dup2 (nfd, 1); |
| 1090 | dup2(nfd, 2); | 1090 | dup2 (nfd, 2); |
| 1091 | close (nfd); | 1091 | close (nfd); |
| 1092 | is_daemon = 1; | 1092 | is_daemon = 1; |
| 1093 | #ifdef HAVE_SETSID | 1093 | #ifdef HAVE_SETSID |
| @@ -2383,8 +2383,8 @@ decode_env_path (evarname, defalt) | |||
| 2383 | } | 2383 | } |
| 2384 | 2384 | ||
| 2385 | DEFUN ("daemonp", Fdaemonp, Sdaemonp, 0, 0, 0, | 2385 | DEFUN ("daemonp", Fdaemonp, Sdaemonp, 0, 0, 0, |
| 2386 | doc: /* Make the current emacs process a daemon.*/) | 2386 | doc: /* Return t if the current emacs process is a daemon. */) |
| 2387 | (void) | 2387 | () |
| 2388 | { | 2388 | { |
| 2389 | return is_daemon ? Qt : Qnil; | 2389 | return is_daemon ? Qt : Qnil; |
| 2390 | } | 2390 | } |