From a84f24d39dcab19f765aef6ec9778a8b6afdd7dd1b4291e1a8093f8322314e71 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Tue, 25 Nov 2014 09:47:17 +0000 Subject: [PATCH] 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 --- 1096-new-udev-root-symlink-generator.patch | 15 ++++++++------- systemd-mini.changes | 6 ++++++ systemd.changes | 6 ++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/1096-new-udev-root-symlink-generator.patch b/1096-new-udev-root-symlink-generator.patch index c7961f37..49c1b2c9 100644 --- a/1096-new-udev-root-symlink-generator.patch +++ b/1096-new-udev-root-symlink-generator.patch @@ -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 + * @@ -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; + } + } + diff --git a/systemd-mini.changes b/systemd-mini.changes index c3fa60e5..f50611e0 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -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 diff --git a/systemd.changes b/systemd.changes index c3fa60e5..f50611e0 100644 --- a/systemd.changes +++ b/systemd.changes @@ -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