diff options
| author | Glenn Morris | 2015-06-13 16:35:54 -0700 |
|---|---|---|
| committer | Glenn Morris | 2015-06-13 16:35:54 -0700 |
| commit | 9bdd1c4c90bc19904f63361c32ebd4304f038aaf (patch) | |
| tree | 283710df50ee1a71c41e9811814f345c3a171d66 /src | |
| parent | 8afef016e2bc413c7a4913554ea6ed2c55474de6 (diff) | |
| download | emacs-9bdd1c4c90bc19904f63361c32ebd4304f038aaf.tar.gz emacs-9bdd1c4c90bc19904f63361c32ebd4304f038aaf.zip | |
* src/xsmfns.c (x_session_initialize): Avoid libSM crash
when starup directory is missing. (Bug#18851)
(errno.h): Include it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xsmfns.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xsmfns.c b/src/xsmfns.c index 48aaa9bef8a..3b06f7133c7 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 28 | 28 | ||
| 29 | #include <unistd.h> | 29 | #include <unistd.h> |
| 30 | #include <sys/param.h> | 30 | #include <sys/param.h> |
| 31 | #include <errno.h> | ||
| 31 | #include <stdio.h> | 32 | #include <stdio.h> |
| 32 | 33 | ||
| 33 | #include "lisp.h" | 34 | #include "lisp.h" |
| @@ -402,6 +403,14 @@ x_session_initialize (struct x_display_info *dpyinfo) | |||
| 402 | SmcCallbacks callbacks; | 403 | SmcCallbacks callbacks; |
| 403 | ptrdiff_t name_len = 0; | 404 | ptrdiff_t name_len = 0; |
| 404 | 405 | ||
| 406 | /* libSM seems to crash if pwd is missing - see bug#18851. */ | ||
| 407 | if (! get_current_dir_name ()) | ||
| 408 | { | ||
| 409 | fprintf (stderr, "Disabling session management due to pwd error: %s\n", | ||
| 410 | emacs_strerror (errno)); | ||
| 411 | return; | ||
| 412 | } | ||
| 413 | |||
| 405 | ice_fd = -1; | 414 | ice_fd = -1; |
| 406 | doing_interact = false; | 415 | doing_interact = false; |
| 407 | 416 | ||