summaryrefslogtreecommitdiff
path: root/udev/udev-util.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-11-06 02:56:45 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-11-06 02:56:45 +0100
commit90024521e73a734f668b8168f1577bd0d02f3b7b (patch)
treea3ed43928235fb18fc0a7e7424d0d132e49a8e14 /udev/udev-util.c
parent3f3aa9f57cdd1aacf9fba1c90bacd1840392b7e8 (diff)
fix indentation
Diffstat (limited to 'udev/udev-util.c')
-rw-r--r--udev/udev-util.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/udev/udev-util.c b/udev/udev-util.c
index 2620d9a994..271941b8ff 100644
--- a/udev/udev-util.c
+++ b/udev/udev-util.c
@@ -135,46 +135,46 @@ uid_t util_lookup_user(struct udev *udev, const char *user)
if (strcmp(user, "root") == 0)
return 0;
- uid = strtoul(user, &endptr, 10);
- if (endptr[0] == '\0')
- return uid;
-
- errno = 0;
- getpwnam_r(user, &pwbuf, buf, buflen, &pw);
- if (pw != NULL)
- return pw->pw_uid;
- if (errno == 0 || errno == ENOENT || errno == ESRCH)
- err(udev, "specified user '%s' unknown\n", user);
- else
- err(udev, "error resolving user '%s': %m\n", user);
- return 0;
- }
+ uid = strtoul(user, &endptr, 10);
+ if (endptr[0] == '\0')
+ return uid;
+
+ errno = 0;
+ getpwnam_r(user, &pwbuf, buf, buflen, &pw);
+ if (pw != NULL)
+ return pw->pw_uid;
+ if (errno == 0 || errno == ENOENT || errno == ESRCH)
+ err(udev, "specified user '%s' unknown\n", user);
+ else
+ err(udev, "error resolving user '%s': %m\n", user);
+ return 0;
+}
- extern gid_t util_lookup_group(struct udev *udev, const char *group)
- {
- char *endptr;
- int buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
- char buf[buflen];
- struct group grbuf;
- struct group *gr;
- gid_t gid = 0;
+extern gid_t util_lookup_group(struct udev *udev, const char *group)
+{
+ char *endptr;
+ int buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+ char buf[buflen];
+ struct group grbuf;
+ struct group *gr;
+ gid_t gid = 0;
- if (strcmp(group, "root") == 0)
- return 0;
- gid = strtoul(group, &endptr, 10);
- if (endptr[0] == '\0')
- return gid;
-
- errno = 0;
- getgrnam_r(group, &grbuf, buf, buflen, &gr);
- if (gr != NULL)
- return gr->gr_gid;
- if (errno == 0 || errno == ENOENT || errno == ESRCH)
- err(udev, "specified group '%s' unknown\n", group);
- else
- err(udev, "error resolving group '%s': %m\n", group);
+ if (strcmp(group, "root") == 0)
return 0;
- }
+ gid = strtoul(group, &endptr, 10);
+ if (endptr[0] == '\0')
+ return gid;
+
+ errno = 0;
+ getgrnam_r(group, &grbuf, buf, buflen, &gr);
+ if (gr != NULL)
+ return gr->gr_gid;
+ if (errno == 0 || errno == ENOENT || errno == ESRCH)
+ err(udev, "specified group '%s' unknown\n", group);
+ else
+ err(udev, "error resolving group '%s': %m\n", group);
+ return 0;
+}
/* handle "[<SUBSYSTEM>/<KERNEL>]<attribute>" format */
int util_resolve_subsys_kernel(struct udev *udev, const char *string,