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:
86e339c
)
test: improve btrfs test case
author
Lennart Poettering
<lennart@poettering.net>
Fri, 26 Dec 2014 15:59:53 +0000
(16:59 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 26 Dec 2014 18:21:58 +0000
(19:21 +0100)
src/test/test-btrfs.c
patch
|
blob
|
history
diff --git
a/src/test/test-btrfs.c
b/src/test/test-btrfs.c
index 4a08c72fbb5c9ed5b69459f7f1b7d62d77834ff9..43b445d8312a3e7249cffeae3b9af8c84535040a 100644
(file)
--- a/
src/test/test-btrfs.c
+++ b/
src/test/test-btrfs.c
@@
-29,26
+29,30
@@
int main(int argc, char *argv[]) {
int r;
int main(int argc, char *argv[]) {
int r;
- BtrfsSubvolInfo info;
- char ts[FORMAT_TIMESTAMP_MAX];
int fd;
fd = open("/", O_RDONLY|O_CLOEXEC|O_DIRECTORY);
if (fd < 0)
log_error_errno(errno, "Failed to open root directory: %m");
else {
int fd;
fd = open("/", O_RDONLY|O_CLOEXEC|O_DIRECTORY);
if (fd < 0)
log_error_errno(errno, "Failed to open root directory: %m");
else {
+ BtrfsSubvolInfo info;
+ char ts[FORMAT_TIMESTAMP_MAX];
+
r = btrfs_subvol_get_info_fd(fd, &info);
if (r < 0)
log_error_errno(r, "Failed to get subvolume info: %m");
else {
log_info("otime: %s", format_timestamp(ts, sizeof(ts), info.otime));
r = btrfs_subvol_get_info_fd(fd, &info);
if (r < 0)
log_error_errno(r, "Failed to get subvolume info: %m");
else {
log_info("otime: %s", format_timestamp(ts, sizeof(ts), info.otime));
- log_info("read-only: %s", yes_no(info.read_only));
+ log_info("read-only
(search)
: %s", yes_no(info.read_only));
}
r = btrfs_subvol_get_read_only_fd(fd);
}
r = btrfs_subvol_get_read_only_fd(fd);
- assert_se(r >= 0);
+ if (r < 0)
+ log_error_errno(r, "Failed to get read only flag: %m");
+ else
+ log_info("read-only (ioctl): %s", yes_no(r));
-
log_info("read-only: %s", yes_no(r)
);
+
safe_close(fd
);
}
r = btrfs_subvol_make("/xxxtest");
}
r = btrfs_subvol_make("/xxxtest");