comparison src/buffer.c @ 19581:30f977ea74db

Include errno.h. (init_buffer) [HAVE_GETCWD]: Fix error message for getcwd failure.
author Richard M. Stallman <rms@gnu.org>
date Wed, 27 Aug 1997 20:01:05 +0000
parents 3fce1e7c0fd0
children 7482ad23e430
comparison
equal deleted inserted replaced
19580:a81fbc76f500 19581:30f977ea74db
21 21
22 22
23 #include <sys/types.h> 23 #include <sys/types.h>
24 #include <sys/stat.h> 24 #include <sys/stat.h>
25 #include <sys/param.h> 25 #include <sys/param.h>
26 #include <errno.h>
27
28 extern int errno;
26 29
27 #ifndef MAXPATHLEN 30 #ifndef MAXPATHLEN
28 /* in 4.1, param.h fails to define this. */ 31 /* in 4.1, param.h fails to define this. */
29 #define MAXPATHLEN 1024 32 #define MAXPATHLEN 1024
30 #endif /* not MAXPATHLEN */ 33 #endif /* not MAXPATHLEN */
3706 && dotstat.st_dev == pwdstat.st_dev 3709 && dotstat.st_dev == pwdstat.st_dev
3707 && strlen (pwd) < MAXPATHLEN) 3710 && strlen (pwd) < MAXPATHLEN)
3708 strcpy (buf, pwd); 3711 strcpy (buf, pwd);
3709 #ifdef HAVE_GETCWD 3712 #ifdef HAVE_GETCWD
3710 else if (getcwd (buf, MAXPATHLEN+1) == 0) 3713 else if (getcwd (buf, MAXPATHLEN+1) == 0)
3711 fatal ("`getcwd' failed: %s\n", buf); 3714 fatal ("`getcwd' failed: %s\n", strerror (errno));
3712 #else 3715 #else
3713 else if (getwd (buf) == 0) 3716 else if (getwd (buf) == 0)
3714 fatal ("`getwd' failed: %s\n", buf); 3717 fatal ("`getwd' failed: %s\n", buf);
3715 #endif 3718 #endif
3716 3719