Skip to contentSkip to conversation

udev and existing symlinks

PATCH Marco d'Itri 2 participants 3 messages Dec 25, 2003 – Dec 30, 2003

lore
Share & tools
lore
#0 lore raw

Without this patch udev will fail when a symlink already exists.

udev-add.c +2 -0
diff -ruN udev-011.orig/udev-add.c udev-011/udev-add.c
@@ -223,6 +223,8 @@
 
 			dbg("symlink(%s, %s)", linktarget, filename);
 			retval = symlink(linktarget, filename);
+			if (retval && errno = EEXIST)
+			    retval = 0;
 			if (retval)
 				dbg("symlink(%s, %s) failed with error '%s'",
 				    linktarget, filename, strerror(errno));
Signature · 13 lines
ciao, |
Marco | [3783 l'aPjd9wP9m5M]


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 6 lines · Marco d'Itri

Without this patch udev will fail when a symlink already exists.

diff -ruN udev-011.orig/udev-add.c udev-011/udev-add.c

udev-add.c line 230

Quoted 8 lines
udev-add.c +2 -0
@@ -223,6 +223,8 @@
 
 			dbg("symlink(%s, %s)", linktarget, filename);
 			retval = symlink(linktarget, filename);
+			if (retval && errno = EEXIST)
+			    retval = 0;
 			if (retval)
 				dbg("symlink(%s, %s) failed with error '%s'",
 				    linktarget, filename, strerror(errno));

The patch from Martin Schlemmer should keep this from happening, right?

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Marco d'Itri
Quoted 1 line · Greg KH

The patch from Martin Schlemmer should keep this from happening, right?

Yes.

Signature · 13 lines
ciao, |
Marco | [3831 steKgx0IoT.So]


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel