summaryrefslogtreecommitdiffstats
path: root/src/shared/fstab-util.c
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2019-12-03 19:36:37 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-12-04 08:57:08 +0100
commit7477451b691d288dad67b4c8ce9e519e9b75770d (patch)
treeda1a5d45622aafeb7c6ff01400732f2443a06b58 /src/shared/fstab-util.c
parenthwdb: Set trackball property for Logitech MX Ergo (#14231) (diff)
downloadsystemd-7477451b691d288dad67b4c8ce9e519e9b75770d.tar.xz
systemd-7477451b691d288dad67b4c8ce9e519e9b75770d.zip
core: swap priority can be negative
Negative priorities are useful for swap targets which should be only used as last resort.
Diffstat (limited to 'src/shared/fstab-util.c')
-rw-r--r--src/shared/fstab-util.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
index f90501eb92..86a57e6b2c 100644
--- a/src/shared/fstab-util.c
+++ b/src/shared/fstab-util.c
@@ -186,8 +186,7 @@ int fstab_extract_values(const char *opts, const char *name, char ***values) {
int fstab_find_pri(const char *options, int *ret) {
_cleanup_free_ char *opt = NULL;
- int r;
- unsigned pri;
+ int r, pri;
assert(ret);
@@ -197,14 +196,11 @@ int fstab_find_pri(const char *options, int *ret) {
if (r == 0 || !opt)
return 0;
- r = safe_atou(opt, &pri);
+ r = safe_atoi(opt, &pri);
if (r < 0)
return r;
- if ((int) pri < 0)
- return -ERANGE;
-
- *ret = (int) pri;
+ *ret = pri;
return 1;
}