diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2014-08-05 17:03:25 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-08-05 17:03:25 -0400 |
commit | 4b8733ffe9c0fe8e5a527186d323dab93e43fb37 (patch) | |
tree | 54e6e64995f65e619fdbd9a40b2b1e83244507b7 /src/udev | |
parent | e35ef44ebe788aaffd1f6910750492bacaba7b6f (diff) |
src/{libudev,udev}: minor renamings from upstream
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/dev-setup.c | 18 | ||||
-rw-r--r-- | src/udev/dev-setup.h | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/udev/dev-setup.c b/src/udev/dev-setup.c index 50a187fda9..1a565d5470 100644 --- a/src/udev/dev-setup.c +++ b/src/udev/dev-setup.c @@ -50,7 +50,7 @@ static int symlink_and_label(const char *old_path, const char *new_path) { return r; } -void dev_setup(const char *prefix) { +int dev_setup(const char *prefix) { const char *j, *k; static const char symlinks[] = @@ -64,21 +64,21 @@ void dev_setup(const char *prefix) { if (j[0] == '-') { j++; - if (access(j, F_OK)) + if (access(j, F_OK) < 0) continue; } if (prefix) { - char *linkname; + _cleanup_free_ char *link_name = NULL; - if (asprintf(&linkname, "%s/%s", prefix, k) < 0) { - log_oom(); - break; - } + link_name = strjoin(prefix, "/", k, NULL); + if (!link_name) + return -ENOMEM; - symlink_and_label(j, linkname); - free(linkname); + symlink_and_label(j, link_name); } else symlink_and_label(j, k); } + + return 0; } diff --git a/src/udev/dev-setup.h b/src/udev/dev-setup.h index 320c0b30ba..d41b6eefba 100644 --- a/src/udev/dev-setup.h +++ b/src/udev/dev-setup.h @@ -21,4 +21,4 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -void dev_setup(const char *pathprefix); +int dev_setup(const char *pathprefix); |