Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 296471

Summary: core.filesystem natives incorrectly determine file type
Product: [Eclipse Project] Platform Reporter: Dmitry Karasik <Dmitry_Karasik>
Component: ResourcesAssignee: Pawel Pogorzelski <pawel.pogorzelski1>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: john.camelon, pawel.pogorzelski1, Szymon.Brandys
Version: 3.6   
Target Milestone: 3.6 M5   
Hardware: All   
OS: Unix All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 295991    
Attachments:
Description Flags
Patch_v01
none
Native library recompiled for Mac OS X
none
Native library recompiled for Linux x86
none
Native library recompiled for Linux x86_64
none
Native library recompiled for AIX PPC
none
Native library recompiled for AIX PPC64
none
Native library recompiled for Solaris SPARC
none
Native library recompiled for Solaris SPARC V9 none

Description Dmitry Karasik CLA 2009-11-30 09:06:43 EST
The code for determining file type (dir, symlink) looks like:
(info.st_mode & S_IFDIR) == S_IFDIR)

This is wrong, S_IFDIR is not a mask. This causes problems on linux, for example a block device and socket files are detected as directories. It's even worse on USS where files are detected as directories (so effectively everything looks like a directory)

More correct code would look like:

(info.st_mode & S_IFMT) == S_IFDIR)

However it's probably better to use the standard POSIX macros:

S_ISDIR(info.st_mode) and S_ISLNK(info.st_mode)
Comment 1 Szymon Brandys CLA 2009-12-07 06:09:25 EST
Moving to M5.
Comment 2 Pawel Pogorzelski CLA 2009-12-15 09:25:49 EST
Created attachment 154473 [details]
Patch_v01
Comment 3 Pawel Pogorzelski CLA 2009-12-15 09:26:37 EST
Created attachment 154474 [details]
Native library recompiled for Mac OS X
Comment 4 Pawel Pogorzelski CLA 2009-12-15 10:37:17 EST
Created attachment 154486 [details]
Native library recompiled for Linux x86
Comment 5 Pawel Pogorzelski CLA 2009-12-15 10:44:51 EST
Created attachment 154487 [details]
Native library recompiled for Linux x86_64
Comment 6 Pawel Pogorzelski CLA 2009-12-15 12:00:06 EST
Created attachment 154495 [details]
Native library recompiled for AIX PPC
Comment 7 Pawel Pogorzelski CLA 2009-12-15 12:02:02 EST
Created attachment 154496 [details]
Native library recompiled for AIX PPC64
Comment 8 Pawel Pogorzelski CLA 2009-12-15 12:35:24 EST
Created attachment 154499 [details]
Native library recompiled for Solaris SPARC
Comment 9 Pawel Pogorzelski CLA 2009-12-15 12:36:43 EST
Created attachment 154500 [details]
Native library recompiled for Solaris SPARC V9
Comment 10 Pawel Pogorzelski CLA 2009-12-15 12:48:17 EST
Szymon, libs were recompiled on the same machines as last time. No changes in BUILD_INFO.txt are required apart the build date.
Comment 11 Szymon Brandys CLA 2009-12-16 06:56:52 EST
The patch and all libraries are released to HEAD.
Comment 12 Pawel Pogorzelski CLA 2009-12-16 08:22:08 EST
I've checked the code in HEAD, looks good. Marking as FIXED.