forked from pool/systemd
Accepting request 262951 from home:rmilasan:branches:Base:System
- Fix error return in rootsymlink_generator.c Update 1096-new-udev-root-symlink-generator.patch - Fix error return in rootsymlink_generator.c Update 1096-new-udev-root-symlink-generator.patch OBS-URL: https://build.opensuse.org/request/show/262951 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=824
This commit is contained in:
parent
9a0a8a529e
commit
871d1f50b0
@ -32,7 +32,7 @@ Index: systemd-210/src/udev/rootsymlink_generator/rootsymlink_generator.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ systemd-210/src/udev/rootsymlink_generator/rootsymlink_generator.c
|
||||
@@ -0,0 +1,64 @@
|
||||
@@ -0,0 +1,65 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2014-2015 Robert Milasan <rmilasan@suse.com>
|
||||
+ *
|
||||
@ -69,29 +69,30 @@ Index: systemd-210/src/udev/rootsymlink_generator/rootsymlink_generator.c
|
||||
+ struct stat statbuf;
|
||||
+
|
||||
+ if (stat(_ROOTDEV_, &statbuf) != 0)
|
||||
+ return -errno;
|
||||
+ return 1;
|
||||
+
|
||||
+ if (major(statbuf.st_dev) > 0) {
|
||||
+ int fd = -1;
|
||||
+ char filename[BUFFER_SIZE];
|
||||
+
|
||||
+ if (mkdir(_PATH_, 0755) != 0 && errno != EEXIST)
|
||||
+ return -errno;
|
||||
+ return errno;
|
||||
+
|
||||
+ snprintf(filename, BUFFER_SIZE, "%s/%s", _PATH_, _FILE_);
|
||||
+
|
||||
+ if ((fd = open(filename, O_CREAT|O_WRONLY|O_TRUNC, 0644)) == -1)
|
||||
+ return -errno;
|
||||
+ return errno;
|
||||
+ else {
|
||||
+ char buf[BUFFER_SIZE];
|
||||
+
|
||||
+ snprintf(buf, BUFFER_SIZE, "ACTION==\"add|change\", SUBSYSTEM==\"block\", ENV{MAJOR}==\"%d\", ENV{MINOR}==\"%d\", SYMLINK+=\"root\"\n",
|
||||
+ major(statbuf.st_dev), minor(statbuf.st_dev));
|
||||
+
|
||||
+ if (write(fd, buf, strlen(buf)) != strlen(buf))
|
||||
+ return -errno;
|
||||
+ if (write(fd, buf, strlen(buf)) == -1)
|
||||
+ return errno;
|
||||
+
|
||||
+ close(fd);
|
||||
+ if (close(fd) == -1)
|
||||
+ return errno;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 25 09:44:42 UTC 2014 - rmilasan@suse.com
|
||||
|
||||
- Fix error return in rootsymlink_generator.c
|
||||
Update 1096-new-udev-root-symlink-generator.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 21 13:35:40 UTC 2014 - werner@suse.de
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 25 09:44:42 UTC 2014 - rmilasan@suse.com
|
||||
|
||||
- Fix error return in rootsymlink_generator.c
|
||||
Update 1096-new-udev-root-symlink-generator.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 21 13:35:40 UTC 2014 - werner@suse.de
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user