Bug 52099

Summary: makedepend rename fails on CIFS mounted shares
Product: xorg Reporter: Glenn Burkhardt <gbburkhardt>
Component: App/otherAssignee: Alan Coopersmith <alan.coopersmith>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium Keywords: patch
Version: 7.7 (2012.06)   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch for rename bug on CIFS mounted shares. none

Description Glenn Burkhardt 2012-07-14 20:11:56 UTC
Created attachment 64218 [details] [review]
patch for rename bug on CIFS mounted shares.

When a filesystem is mounted with 'smbfs', or as a shared folder in VirtualBox, and the filesystem host is a Windows system, 'makedepend' will fail when it tries to rename the target makefile. It's been recognized that this operation doesn't work, for there is conditional code to handle it when the target OS is WIN32, UNIXOS2, or CYGWIN. The problem is that if the program has opened the 'makefile', and has an active file descriptor to the file, the 'rename()' function won't work.

A modest rewrite of the code will allow it to work for all OS's, and avoid the conditional code. The check for file exists can be made by handing the return from 'stat()' in the case when "-f" has specified the 'makefile'.

Please see attached patch.
Comment 1 Alan Coopersmith 2013-01-12 06:32:10 UTC
Thanks.   I've tweaked the patch a little, so that if the file isn't readable
we don't leave it under the backup name but move it back to the original name,
and posted it to xorg-devel for review:

http://patchwork.freedesktop.org/patch/12843/
Comment 2 Alan Coopersmith 2013-01-19 16:27:14 UTC
Thanks, revised patch has been pushed to git master for the next release:
http://cgit.freedesktop.org/xorg/util/makedepend/commit/?id=059e9be5a7321974b190d786d426b2ae27be8c56

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.