chiark / gitweb /
util: never use ether_ntoa(), since it formats with %x, not %02x, which makes etherne...
[elogind.git] / src / shared / util.c
index 347fa12098f4ce1d4ec0d03b8d478e9dcbdb8fed..0db4bd90e89cb09137381ab56c99d5e2ff3e48ad 100644 (file)
@@ -3056,7 +3056,7 @@ int status_vprintf(const char *status, bool ellipse, bool ephemeral, const char
                 if (emax < 3)
                         emax = 3;
 
-                e = ellipsize(s, emax, 75);
+                e = ellipsize(s, emax, 50);
                 if (e) {
                         free(s);
                         s = e;
@@ -6918,3 +6918,15 @@ int take_password_lock(const char *root) {
 
         return fd;
 }
+
+int is_symlink(const char *path) {
+        struct stat info;
+
+        if (lstat(path, &info) < 0)
+                return -errno;
+
+        if (S_ISLNK(info.st_mode))
+                return 1;
+
+        return 0;
+}
\ No newline at end of file