Mercurial > emacs
comparison src/fileio.c @ 15738:4ccf88623c95
(check_writable): Use euidaccess, not eaccess.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sat, 20 Jul 1996 07:00:51 +0000 |
parents | 537b4cdf9eff |
children | 63b85944e37b |
comparison
equal
deleted
inserted
replaced
15737:ee65afcb46d7 | 15738:4ccf88623c95 |
---|---|
2566 struct stat st; | 2566 struct stat st; |
2567 if (stat (filename, &st) < 0) | 2567 if (stat (filename, &st) < 0) |
2568 return 0; | 2568 return 0; |
2569 return (st.st_mode & S_IWRITE || (st.st_mode & S_IFMT) == S_IFDIR); | 2569 return (st.st_mode & S_IWRITE || (st.st_mode & S_IFMT) == S_IFDIR); |
2570 #else /* not MSDOS */ | 2570 #else /* not MSDOS */ |
2571 #ifdef HAVE_EACCESS | 2571 #ifdef HAVE_EUIDACCESS |
2572 return (eaccess (filename, 2) >= 0); | 2572 return (euidaccess (filename, 2) >= 0); |
2573 #else | 2573 #else |
2574 /* Access isn't quite right because it uses the real uid | 2574 /* Access isn't quite right because it uses the real uid |
2575 and we really want to test with the effective uid. | 2575 and we really want to test with the effective uid. |
2576 But Unix doesn't give us a right way to do it. | 2576 But Unix doesn't give us a right way to do it. |
2577 Opening with O_WRONLY could work for an ordinary file, | 2577 Opening with O_WRONLY could work for an ordinary file, |