Changeset 78 for trunk/src/sh_unix.c
- Timestamp:
- Jan 9, 2007, 10:32:21 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_unix.c
r76 r78 3833 3833 /* Test whether file exists 3834 3834 */ 3835 int sh_unix_file_ stat(char * path)3835 int sh_unix_file_exists(char * path) 3836 3836 { 3837 3837 struct stat buf; 3838 3838 3839 SL_ENTER(_("sh_unix_file_ stat"));3839 SL_ENTER(_("sh_unix_file_exists")); 3840 3840 3841 3841 if (-1 == retry_stat(FIL__, __LINE__, path, &buf)) 3842 SL_RETURN( (0), _("sh_unix_file_stat"));3842 SL_RETURN( S_FALSE, _("sh_unix_file_exists")); 3843 3843 else 3844 SL_RETURN( (-1), _("sh_unix_file_stat"));3845 } 3846 3847 3848 /* Test whether file exists, is a character device, a llows read3849 * access , and is not world writeable.3844 SL_RETURN( S_TRUE, _("sh_unix_file_exists")); 3845 } 3846 3847 3848 /* Test whether file exists, is a character device, and allows read 3849 * access. 3850 3850 */ 3851 int sh_unix_ file_exists(int fd)3851 int sh_unix_device_readable(int fd) 3852 3852 { 3853 3853 struct stat buf; 3854 3854 3855 SL_ENTER(_("sh_unix_ file_exists"));3855 SL_ENTER(_("sh_unix_device_readable")); 3856 3856 3857 3857 if (retry_fstat(FIL__, __LINE__, fd, &buf) == -1) 3858 SL_RETURN( (-1), _("sh_unix_file_exists")); 3859 else if ( S_ISCHR(buf.st_mode) && 0 != (S_IROTH & buf.st_mode) 3860 /* 3861 * #if !defined(__CYGWIN32__) && !defined(__CYGWIN__) 3862 * && 0 == (S_IWOTH & buf.st_mode) 3863 * #endif 3864 */ 3865 ) 3866 SL_RETURN( (0), _("sh_unix_file_exists")); 3858 SL_RETURN( (-1), _("sh_unix_device_readable")); 3859 else if ( S_ISCHR(buf.st_mode) && 0 != (S_IROTH & buf.st_mode) ) 3860 SL_RETURN( (0), _("sh_unix_device_readable")); 3867 3861 else 3868 SL_RETURN( (-1), _("sh_unix_ file_exists"));3862 SL_RETURN( (-1), _("sh_unix_device_readable")); 3869 3863 } 3870 3864
Note:
See TracChangeset
for help on using the changeset viewer.