cmd: add /status.json
to describe what and how it works
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
#include "util/opts/opts.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
char *
|
||||
strstrn(const char *s, const char *find, size_t len)
|
||||
@ -101,3 +102,17 @@ int ioctl_retried(const char *name, int fd, int request, void *arg)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *trim(char *s)
|
||||
{
|
||||
// skip left side white spaces
|
||||
while (isspace (*s))
|
||||
s++;
|
||||
|
||||
// skip right side white spaces
|
||||
char *e = s + strlen(s) - 1;
|
||||
while (e >= s && isspace(*e))
|
||||
*e-- = 0;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ bool filter_log(const char *filename);
|
||||
uint64_t get_monotonic_time_us(struct timespec *ts, struct timeval *tv);
|
||||
uint64_t get_time_us(clockid_t clock, struct timespec *ts, struct timeval *tv, int64_t delays_us);
|
||||
int shrink_to_block(int size, int block);
|
||||
char *trim(char *s);
|
||||
|
||||
int ioctl_retried(const char *name, int fd, int request, void *arg);
|
||||
|
||||
|
Reference in New Issue
Block a user