GNOME Bugzilla – Bug 100611
ensure_directory fails with "File Exists"
Last modified: 2006-06-18 05:24:59 UTC
When creating a new directory for a save tasks, pan/base/util-file's directory function will incorrectly return a "Couldn't create directory foo: file exists" The task retries and so it works, but it's still annoying for the error icon to pop up in the lower right. ** (pan:1149): WARNING **: Couldn't create directory "/var/tmp/pix": File exists ** (pan:1149): WARNING **: Decode can't access path "/var/tmp/pix/Petunia" ** (pan:1149): WARNING **: Couldn't create directory "/var/tmp/pix/Darla": File exists ** (pan:1149): WARNING **: Decode can't access path "/var/tmp/pix/Darla" ** (pan:1150): WARNING **: Couldn't create directory "/var/tmp/pix/Darla": File exists ** (pan:1150): WARNING **: Decode can't access path "/var/tmp/pix/Darla" ** (pan:1147): WARNING **: Couldn't create directory "/var/tmp/pix/Darla": File exists ** (pan:1147): WARNING **: Decode can't access path "/var/tmp/pix/Darla"
Looks like this is being caused by 2..n tasks kicking off at the same time and reaching pan_file_ensure_path_exists() at the same time. I've committed a possible fix by adding a GStaticMutex to pan_file_ensure_path_exists(). http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan/base&command=DIFF_FRAMESET&file=util-file.c&rev1=1.33&rev2=1.34&root=/cvs/gnome