projects
/
platform
/
upstream
/
btrfs-progs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
btrfs-progs: tests: add shell quotes to misc test scripts
[platform/upstream/btrfs-progs.git]
/
send-dump.c
diff --git
a/send-dump.c
b/send-dump.c
index
064c914
..
1591e0c
100644
(file)
--- a/
send-dump.c
+++ b/
send-dump.c
@@
-112,11
+112,14
@@
static int __print_dump(int subvol, void *user, const char *path,
/* Unified header */
printf("%-16s", title);
ret = print_path_escaped(out_path);
/* Unified header */
printf("%-16s", title);
ret = print_path_escaped(out_path);
- if (!fmt)
+ if (!fmt) {
+ putchar('\n');
return 0;
return 0;
- /* Short paths ale aligned to 32 chars */
- while (ret++ < 32)
+ }
+ /* Short paths are aligned to 32 chars; longer paths get a single space */
+ do {
putchar(' ');
putchar(' ');
+ } while (++ret < 32);
va_start(args, fmt);
/* Operation specified ones */
vprintf(fmt, args);
va_start(args, fmt);
/* Operation specified ones */
vprintf(fmt, args);
@@
-271,16
+274,15
@@
static int print_chown(const char *path, u64 uid, u64 gid, void *user)
static int sprintf_timespec(struct timespec *ts, char *dest, int max_size)
{
static int sprintf_timespec(struct timespec *ts, char *dest, int max_size)
{
- struct tm
*
tm;
+ struct tm tm;
int ret;
int ret;
- tm = localtime(&ts->tv_sec);
- if (!tm) {
+ if (!localtime_r(&ts->tv_sec, &tm)) {
error("failed to convert time %lld.%.9ld to local time",
(long long)ts->tv_sec, ts->tv_nsec);
return -EINVAL;
}
error("failed to convert time %lld.%.9ld to local time",
(long long)ts->tv_sec, ts->tv_nsec);
return -EINVAL;
}
- ret = strftime(dest, max_size, "%FT%T%z", tm);
+ ret = strftime(dest, max_size, "%FT%T%z",
&
tm);
if (ret == 0) {
error(
"time %lld.%ld is too long to convert into readable string",
if (ret == 0) {
error(
"time %lld.%ld is too long to convert into readable string",