Package init

This commit is contained in:
dogsheng 2019-12-13 15:46:40 +08:00
parent 8330d04949
commit 8f0025ab9f
4 changed files with 5 additions and 5 deletions

View File

@ -91,7 +91,7 @@ index 6387012..91de9f9 100644
+ lxcfs_error("Error opening pipe for reading: %s\n", strerror(errno));
+ goto err;
+ }
+ while (fscanf(stream, "%s%d", dev_name, &dev_num) == 2) {
+ while (fscanf(stream, "%100s%d", dev_name, &dev_num) == 2) {
+ if (dev_num == 0) {
+ break;
+ }

View File

@ -657,8 +657,8 @@ index 9b9f180..b921d7e 100644
lxcfs_error("Error opening pipe for reading: %s\n", strerror(errno));
goto err;
}
- while (fscanf(stream, "%s%d", dev_name, &dev_num) == 2) {
+ while (fscanf(stream[0], "%s%d", dev_name, &dev_num) == 2) {
- while (fscanf(stream, "%100s%d", dev_name, &dev_num) == 2) {
+ while (fscanf(stream[0], "%100s%d", dev_name, &dev_num) == 2) {
if (dev_num == 0) {
break;
}

View File

@ -33,7 +33,7 @@ index b921d7e..1023e7f 100644
}
+ wait_for_pid(child_pid);
+ child_pid = 0;
while (fscanf(stream[0], "%s%d", dev_name, &dev_num) == 2) {
while (fscanf(stream[0], "%100s%d", dev_name, &dev_num) == 2) {
if (dev_num == 0) {
break;
@@ -4148,7 +4161,9 @@ static int proc_diskstats_read(char *buf, size_t size, off_t offset,

View File

@ -63,7 +63,7 @@ diff --git a/bindings.c b/bindings.c
write, write_merged, write_sectors, write_ticks, ios_pgr, tot_ticks, rq_ticks);
- else
+ else if (need_record_diskstats(major, minor)) {
+ sscanf(line, "%u %u %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ sscanf(line, "%u %u %71s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ &major, &minor, tmp_dev_name, &read, &read_merged, &read_sectors, &read_ticks,
+ &write, &write_merged, &write_sectors, &write_ticks, &ios_pgr, &tot_ticks, &rq_ticks);
+ snprintf(lbuf, 256, "%u %u %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",