chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6db615c
)
udev-builtin-blkid: modernizations and minor fixes
author
Lennart Poettering
<lennart@poettering.net>
Fri, 7 Mar 2014 01:34:18 +0000
(
02:34
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 7 Mar 2014 01:40:24 +0000
(
02:40
+0100)
src/udev/udev-builtin-blkid.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-builtin-blkid.c
b/src/udev/udev-builtin-blkid.c
index c806bd6ad85802c6b702d608bad994e0e286f12e..23a24da907fa7ce910e48921324bbe6683e55ac5 100644
(file)
--- a/
src/udev/udev-builtin-blkid.c
+++ b/
src/udev/udev-builtin-blkid.c
@@
-33,7
+33,7
@@
static void print_property(struct udev_device *dev, bool test, const char *name, const char *value)
{
static void print_property(struct udev_device *dev, bool test, const char *name, const char *value)
{
- char s[2
65
];
+ char s[2
56
];
s[0] = '\0';
s[0] = '\0';
@@
-110,7
+110,8
@@
static int probe_superblocks(blkid_probe pr)
blkid_probe_enable_partitions(pr, 1);
blkid_probe_enable_partitions(pr, 1);
- if (!S_ISCHR(st.st_mode) && blkid_probe_get_size(pr) <= 1024 * 1440 &&
+ if (!S_ISCHR(st.st_mode) &&
+ blkid_probe_get_size(pr) <= 1024 * 1440 &&
blkid_probe_is_wholedisk(pr)) {
/*
* check if the small disk is partitioned, if yes then
blkid_probe_is_wholedisk(pr)) {
/*
* check if the small disk is partitioned, if yes then
@@
-120,7
+121,7
@@
static int probe_superblocks(blkid_probe pr)
rc = blkid_do_fullprobe(pr);
if (rc < 0)
rc = blkid_do_fullprobe(pr);
if (rc < 0)
- return rc; /* -1 = error, 1 = nothing, 0 = succes */
+ return rc; /* -1 = error, 1 = nothing, 0 = succes
s
*/
if (blkid_probe_lookup_value(pr, "PTTYPE", NULL, NULL) == 0)
return 0; /* partition table detected */
if (blkid_probe_lookup_value(pr, "PTTYPE", NULL, NULL) == 0)
return 0; /* partition table detected */
@@
-136,7
+137,7
@@
static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
{
int64_t offset = 0;
bool noraid = false;
{
int64_t offset = 0;
bool noraid = false;
- int fd = -1;
+
_cleanup_close_
int fd = -1;
blkid_probe pr;
const char *data;
const char *name;
blkid_probe pr;
const char *data;
const char *name;
@@
-208,10
+209,9
@@
static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
blkid_free_probe(pr);
out:
blkid_free_probe(pr);
out:
- if (fd > 0)
- close(fd);
if (err < 0)
return EXIT_FAILURE;
if (err < 0)
return EXIT_FAILURE;
+
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;
}