chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libudev: queue - _unref() should return the object
[elogind.git]
/
extras
/
fstab_import
/
fstab_import.c
diff --git
a/extras/fstab_import/fstab_import.c
b/extras/fstab_import/fstab_import.c
index 0f4685ae2a89ce89c428b403fa85bd3df0a99314..c66bffb25cb3c2f042f3029fb974e63e755dd913 100644
(file)
--- a/
extras/fstab_import/fstab_import.c
+++ b/
extras/fstab_import/fstab_import.c
@@
-13,8
+13,6
@@
#define _GNU_SOURCE 1
#endif
#define _GNU_SOURCE 1
#endif
-#include "config.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@
-26,7
+24,8
@@
#include <mntent.h>
#include <sys/stat.h>
#include <mntent.h>
#include <sys/stat.h>
-#include "../../udev/udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
static int debug;
static int debug;
@@
-68,9
+67,9
@@
int main(int argc, char *argv[])
{
struct udev *udev;
static const struct option options[] = {
{
struct udev *udev;
static const struct option options[] = {
- { "export",
0
, NULL, 'x' },
- { "debug",
0
, NULL, 'd' },
- { "help",
0
, NULL, 'h' },
+ { "export",
no_argument
, NULL, 'x' },
+ { "debug",
no_argument
, NULL, 'd' },
+ { "help",
no_argument
, NULL, 'h' },
{}
};
char **devices;
{}
};
char **devices;
@@
-82,7
+81,7
@@
int main(int argc, char *argv[])
if (udev == NULL)
goto exit;
if (udev == NULL)
goto exit;
-
loggin
g_init("fstab_id");
+
udev_lo
g_init("fstab_id");
udev_set_log_fn(udev, log_fn);
while (1) {
udev_set_log_fn(udev, log_fn);
while (1) {
@@
-146,14
+145,14
@@
int main(int argc, char *argv[])
if (label[0] == '"' || label[0] == '\'') {
char *pos;
if (label[0] == '"' || label[0] == '\'') {
char *pos;
-
strlcpy(str, &label[1], sizeof(str)
);
+
util_strscpy(str, sizeof(str), &label[1]
);
pos = strrchr(str, label[0]);
if (pos == NULL)
continue;
pos[0] = '\0';
label = str;
}
pos = strrchr(str, label[0]);
if (pos == NULL)
continue;
pos[0] = '\0';
label = str;
}
- if (matches_device_list(udev, devices,
str
)) {
+ if (matches_device_list(udev, devices,
label
)) {
print_fstab_entry(udev, mnt);
rc = 0;
break;
print_fstab_entry(udev, mnt);
rc = 0;
break;
@@
-170,14
+169,14
@@
int main(int argc, char *argv[])
if (uuid[0] == '"' || uuid[0] == '\'') {
char *pos;
if (uuid[0] == '"' || uuid[0] == '\'') {
char *pos;
-
strlcpy(str, &uuid[1], sizeof(str)
);
+
util_strscpy(str, sizeof(str), &uuid[1]
);
pos = strrchr(str, uuid[0]);
if (pos == NULL)
continue;
pos[0] = '\0';
uuid = str;
}
pos = strrchr(str, uuid[0]);
if (pos == NULL)
continue;
pos[0] = '\0';
uuid = str;
}
- if (matches_device_list(udev, devices,
str
)) {
+ if (matches_device_list(udev, devices,
uuid
)) {
print_fstab_entry(udev, mnt);
rc = 0;
break;
print_fstab_entry(udev, mnt);
rc = 0;
break;
@@
-199,6
+198,6
@@
int main(int argc, char *argv[])
exit:
udev_unref(udev);
exit:
udev_unref(udev);
-
loggin
g_close();
+
udev_lo
g_close();
return rc;
}
return rc;
}