changeset: 8:06b22c31a8ae
tag: tip
user: Dimitrios Papastamos <stateless [at] archlinux.us>
date: Tue May 05 03:33:12 2009 -0700
files: Makefile skvm.c
description:
Fixed SIGSEGV when mounting a cdrom/dvd and /etc/fstab holds a symbolic link to the cdrom
drive.
diff -r 0b5ee299f2d4 -r 06b22c31a8ae Makefile
--- a/Makefile Mon May 04 20:03:08 2009 -0700
+++ b/Makefile Tue May 05 03:33:12 2009 -0700
@@ -12,18 +12,18 @@
all: $(bin)
%: %.c
- $(CC) -o $(bin) $(src) $(inc) $(CFLAGS) $(LDFLAGS)
+ $(CC) -ggdb -o $(bin) $(src) $(inc) $(CFLAGS) $(LDFLAGS)
clean:
- @rm -rf $(bin) skvm-${ver}.tar.bz2
+ @rm -rf $(bin) skvm-$(ver).tar.bz2
dist: clean
- @mkdir -p skvm-${ver}
- @cp -R AUTHORS ChangeLog PKGBUILD README skvm.1 ${src} \
- LICENSE HACKING format.sh .astylerc Makefile TODO init skvm-${ver}
- @tar -cf skvm-${ver}.tar skvm-${ver}
- @bzip2 skvm-${ver}.tar
- @rm -rf skvm-${ver}
+ @mkdir -p skvm-$(ver)
+ @cp -R AUTHORS ChangeLog PKGBUILD README skvm.1 $(src) \
+ LICENSE HACKING format.sh .astylerc Makefile TODO init skvm-$(ver)
+ @tar -cf skvm-$(ver).tar skvm-$(ver)
+ @bzip2 skvm-$(ver).tar
+ @rm -rf skvm-$(ver)
install: all
@echo installing executable file to /usr/bin
@@ -34,7 +34,7 @@
@chmod 755 /etc/rc.d/$(bin)
@echo installing manpage at /usr/local/share/man/man1
@mkdir -p /usr/local/share/man/man1
- @sed "s/VERSION/${ver}/g" < skvm.1 > /usr/local/share/man/man1/skvm.1
+ @sed "s/VERSION/$(ver)/g" < skvm.1 > /usr/local/share/man/man1/skvm.1
@chmod 644 /usr/local/share/man/man1/skvm.1
uninstall:
diff -r 0b5ee299f2d4 -r 06b22c31a8ae skvm.c
--- a/skvm.c Mon May 04 20:03:08 2009 -0700
+++ b/skvm.c Tue May 05 03:33:12 2009 -0700
@@ -503,7 +503,7 @@
consider_fstab(struct device_t *device) {
FILE *fp, *mtab;
struct mntent *entry, *i;
- char rlink[1024], *tmp, *str;
+ char rlink[1024], *tmp, *str, *did = NULL;
size_t len;
if (!device)
@@ -513,11 +513,19 @@
if (!fp)
return;
+ if ((did = strrchr(device->did, '/'))) {
+ did = strstr(did, "uuid");
+ if (did) {
+ did = strchr(did, '_');
+ if (did)
+ ++did;
+ }
+ }
+
while ((entry = getmntent(fp))) {
if (!strcmp(device->dev, entry->mnt_fsname)
- || strstr(entry->mnt_fsname,
- strchr(strstr(strrchr(device->did, '/') + 1,
- "uuid"), '_') + 1)
+ || (strstr(entry->mnt_fsname, "UUID=")
+ && did && strstr(entry->mnt_fsname, did))
|| (strstr(entry->mnt_fsname, "LABEL=")
&& strstr(entry->mnt_fsname, device->label))
|| (!resolve_symlink(entry->mnt_fsname, rlink, 1024)
Received on Tue May 05 2009 - 02:33:47 UTC
This archive was generated by hypermail 2.2.0 : Tue May 05 2009 - 02:36:05 UTC