SHA256
1
0
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:
Robert Milasan 2014-11-25 09:47:17 +00:00 committed by Git OBS Bridge
parent 9a0a8a529e
commit 871d1f50b0
3 changed files with 20 additions and 7 deletions

View File

@ -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;
+ }
+ }
+

View File

@ -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

View File

@ -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