diff options
| author | Richard M. Stallman | 1994-09-18 20:01:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-09-18 20:01:47 +0000 |
| commit | ddf0cd07e5ee9058817020ac09ecfe768495b156 (patch) | |
| tree | 1f1a0fad318dc85f99ea9cd2ae9bef07f9371f7e /src | |
| parent | 688f8f7f51c4d99d54527191a6d2fabcf458179b (diff) | |
| download | emacs-ddf0cd07e5ee9058817020ac09ecfe768495b156.tar.gz emacs-ddf0cd07e5ee9058817020ac09ecfe768495b156.zip | |
(Ffile_writable_p): Don't use ro_fsys.
(ro_fsys): Deleted.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/fileio.c b/src/fileio.c index 299eb2d2609..b0b01cef50e 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2292,30 +2292,6 @@ Otherwise returns nil.") | |||
| 2292 | #endif /* not S_IFLNK */ | 2292 | #endif /* not S_IFLNK */ |
| 2293 | } | 2293 | } |
| 2294 | 2294 | ||
| 2295 | #ifdef SOLARIS_BROKEN_ACCESS | ||
| 2296 | /* In Solaris 2.1, the readonly-ness of the filesystem is not | ||
| 2297 | considered by the access system call. This is Sun's bug, but we | ||
| 2298 | still have to make Emacs work. */ | ||
| 2299 | |||
| 2300 | #include <sys/statvfs.h> | ||
| 2301 | |||
| 2302 | static int | ||
| 2303 | ro_fsys (path) | ||
| 2304 | char *path; | ||
| 2305 | { | ||
| 2306 | struct statvfs statvfsb; | ||
| 2307 | |||
| 2308 | if (statvfs(path, &statvfsb)) | ||
| 2309 | return 1; /* error from statvfs, be conservative and say not wrtable */ | ||
| 2310 | else | ||
| 2311 | /* Otherwise, fsys is ro if bit is set. */ | ||
| 2312 | return statvfsb.f_flag & ST_RDONLY; | ||
| 2313 | } | ||
| 2314 | #else | ||
| 2315 | /* But on every other os, access has already done the right thing. */ | ||
| 2316 | #define ro_fsys(path) 0 | ||
| 2317 | #endif | ||
| 2318 | |||
| 2319 | /* Having this before file-symlink-p mysteriously caused it to be forgotten | 2295 | /* Having this before file-symlink-p mysteriously caused it to be forgotten |
| 2320 | on the RT/PC. */ | 2296 | on the RT/PC. */ |
| 2321 | DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | 2297 | DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, |
| @@ -2336,8 +2312,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | |||
| 2336 | return call2 (handler, Qfile_writable_p, abspath); | 2312 | return call2 (handler, Qfile_writable_p, abspath); |
| 2337 | 2313 | ||
| 2338 | if (access (XSTRING (abspath)->data, 0) >= 0) | 2314 | if (access (XSTRING (abspath)->data, 0) >= 0) |
| 2339 | return ((access (XSTRING (abspath)->data, 2) >= 0 | 2315 | return (access (XSTRING (abspath)->data, 2) >= 0 |
| 2340 | && ! ro_fsys ((char *) XSTRING (abspath)->data)) | ||
| 2341 | ? Qt : Qnil); | 2316 | ? Qt : Qnil); |
| 2342 | dir = Ffile_name_directory (abspath); | 2317 | dir = Ffile_name_directory (abspath); |
| 2343 | #ifdef VMS | 2318 | #ifdef VMS |
| @@ -2348,8 +2323,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | |||
| 2348 | if (!NILP (dir)) | 2323 | if (!NILP (dir)) |
| 2349 | dir = Fdirectory_file_name (dir); | 2324 | dir = Fdirectory_file_name (dir); |
| 2350 | #endif /* MSDOS */ | 2325 | #endif /* MSDOS */ |
| 2351 | return ((access (!NILP (dir) ? (char *) XSTRING (dir)->data : "", 2) >= 0 | 2326 | return (access (!NILP (dir) ? (char *) XSTRING (dir)->data : "", 2) >= 0 |
| 2352 | && ! ro_fsys ((char *) XSTRING (dir)->data)) | ||
| 2353 | ? Qt : Qnil); | 2327 | ? Qt : Qnil); |
| 2354 | } | 2328 | } |
| 2355 | 2329 | ||