diff options
| author | Karl Heuer | 1995-07-17 22:27:13 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-07-17 22:27:13 +0000 |
| commit | fe111dafb1c787e2de38fbd8c695954d557e3272 (patch) | |
| tree | 92a0be71f009267dc7717c777ebb41fefcbf735e /src | |
| parent | a03a26dbdf9fd68a5b0be755171c05283dfea5e7 (diff) | |
| download | emacs-fe111dafb1c787e2de38fbd8c695954d557e3272.tar.gz emacs-fe111dafb1c787e2de38fbd8c695954d557e3272.zip | |
(sys_close): Handle Sunos 4.1 bug in close errno value.
(init_system_name): Add cast in init for fqdn.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index be412e2385d..8b77362b98f 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2170,7 +2170,7 @@ init_system_name () | |||
| 2170 | } | 2170 | } |
| 2171 | if (hp) | 2171 | if (hp) |
| 2172 | { | 2172 | { |
| 2173 | char *fqdn = hp->h_name; | 2173 | char *fqdn = (char *) hp->h_name; |
| 2174 | char *p; | 2174 | char *p; |
| 2175 | 2175 | ||
| 2176 | if (!index (fqdn, '.')) | 2176 | if (!index (fqdn, '.')) |
| @@ -2884,10 +2884,19 @@ sys_open (path, oflag, mode) | |||
| 2884 | sys_close (fd) | 2884 | sys_close (fd) |
| 2885 | int fd; | 2885 | int fd; |
| 2886 | { | 2886 | { |
| 2887 | int did_retry = 0; | ||
| 2887 | register int rtnval; | 2888 | register int rtnval; |
| 2888 | 2889 | ||
| 2889 | while ((rtnval = close (fd)) == -1 | 2890 | while ((rtnval = close (fd)) == -1 |
| 2890 | && (errno == EINTR)); | 2891 | && (errno == EINTR)) |
| 2892 | did_retry = 1; | ||
| 2893 | |||
| 2894 | /* If close is interrupted SunOS 4.1 may or may not have closed the | ||
| 2895 | file descriptor. If it did the second close will fail with | ||
| 2896 | errno = EBADF. That means we have succeeded. */ | ||
| 2897 | if (rtnval == -1 && did_retry && errno == EBADF) | ||
| 2898 | return 0; | ||
| 2899 | |||
| 2891 | return rtnval; | 2900 | return rtnval; |
| 2892 | } | 2901 | } |
| 2893 | 2902 | ||