!2 lxcfs: fix new patch format
Merge pull request !2 from openEuler-iSula/master
This commit is contained in:
commit
f980a81bec
@ -1,86 +1,87 @@
|
|||||||
diff --git a/Makefile.am b/Makefile.am
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
index ca73156..ac6066d 100644
|
index ca73156..ac6066d 100644
|
||||||
--- a/Makefile.am
|
--- a/Makefile.am
|
||||||
+++ b/Makefile.am
|
+++ b/Makefile.am
|
||||||
@@ -26,7 +26,7 @@ lxcfs_LTLIBRARIES = liblxcfs.la
|
@@ -26,7 +26,7 @@ lxcfs_LTLIBRARIES = liblxcfs.la
|
||||||
EXTRA_LTLIBRARIES = liblxcfstest.la
|
EXTRA_LTLIBRARIES = liblxcfstest.la
|
||||||
|
|
||||||
lxcfs_SOURCES = lxcfs.c
|
lxcfs_SOURCES = lxcfs.c
|
||||||
-lxcfs_LDADD = -ldl -lsecurec
|
-lxcfs_LDADD = -ldl -lsecurec
|
||||||
+lxcfs_LDADD = -ldl
|
+lxcfs_LDADD = -ldl
|
||||||
lxcfs_CFLAGS = $(AM_CFLAGS)
|
lxcfs_CFLAGS = $(AM_CFLAGS)
|
||||||
lxcfs_LDFLAGS = $(AM_LDFLAGS)
|
lxcfs_LDFLAGS = $(AM_LDFLAGS)
|
||||||
bin_PROGRAMS = lxcfs
|
bin_PROGRAMS = lxcfs
|
||||||
diff --git a/bindings.c b/bindings.c
|
diff --git a/bindings.c b/bindings.c
|
||||||
index 446a1d0..9939661 100644
|
index 446a1d0..9939661 100644
|
||||||
--- a/bindings.c
|
--- a/bindings.c
|
||||||
+++ b/bindings.c
|
+++ b/bindings.c
|
||||||
@@ -39,7 +39,6 @@
|
@@ -39,7 +39,6 @@
|
||||||
|
|
||||||
#include "bindings.h"
|
#include "bindings.h"
|
||||||
#include "config.h" // for VERSION
|
#include "config.h" // for VERSION
|
||||||
-#include "securec.h"
|
-#include "securec.h"
|
||||||
|
|
||||||
/* Maximum number for 64 bit integer is a string with 21 digits: 2^64 - 1 = 21 */
|
/* Maximum number for 64 bit integer is a string with 21 digits: 2^64 - 1 = 21 */
|
||||||
#define LXCFS_NUMSTRLEN64 21
|
#define LXCFS_NUMSTRLEN64 21
|
||||||
@@ -4457,7 +4456,6 @@ err:
|
@@ -4457,7 +4456,6 @@ err:
|
||||||
static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
struct fuse_file_info *fi)
|
struct fuse_file_info *fi)
|
||||||
{
|
{
|
||||||
- int ret = 0;
|
- int ret = 0;
|
||||||
char dev_name[72] = {0};
|
char dev_name[72] = {0};
|
||||||
struct fuse_context *fc = fuse_get_context();
|
struct fuse_context *fc = fuse_get_context();
|
||||||
struct file_info *d = (struct file_info *)fi->fh;
|
struct file_info *d = (struct file_info *)fi->fh;
|
||||||
@@ -4481,13 +4479,7 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
@@ -4481,13 +4479,7 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
return 0;
|
return 0;
|
||||||
int left = d->size - offset;
|
int left = d->size - offset;
|
||||||
total_len = left > size ? size: left;
|
total_len = left > size ? size: left;
|
||||||
- ret = memcpy_s(buf, size, cache + offset, total_len);
|
- ret = memcpy_s(buf, size, cache + offset, total_len);
|
||||||
- if (ret != 0) {
|
- if (ret != 0) {
|
||||||
- lxcfs_error("%s\n", "Internal error: memcpy buf failed");
|
- lxcfs_error("%s\n", "Internal error: memcpy buf failed");
|
||||||
- rv = 0;
|
- rv = 0;
|
||||||
- goto err;
|
- goto err;
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
+ memcpy(buf, cache + offset, total_len);
|
+ memcpy(buf, cache + offset, total_len);
|
||||||
return total_len;
|
return total_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4512,21 +4504,10 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
@@ -4512,21 +4504,10 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
char lbuf[256];
|
char lbuf[256];
|
||||||
|
|
||||||
if (lines < 2) {
|
if (lines < 2) {
|
||||||
- ret = strncpy_s(lbuf, sizeof(lbuf), line, sizeof(lbuf)-1);
|
- ret = strncpy_s(lbuf, sizeof(lbuf), line, sizeof(lbuf)-1);
|
||||||
- if (ret != 0) {
|
- if (ret != 0) {
|
||||||
- lxcfs_error("%s\n", "Internal error: strncpy line failed");
|
- lxcfs_error("%s\n", "Internal error: strncpy line failed");
|
||||||
- rv = 0;
|
- rv = 0;
|
||||||
- goto err;
|
- goto err;
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
+ strncpy(lbuf, line, sizeof(lbuf)-1);
|
+ strncpy(lbuf, line, sizeof(lbuf)-1);
|
||||||
lines++;
|
lines++;
|
||||||
} else {
|
} else {
|
||||||
- ret = memset_s(dev_name, sizeof(dev_name), 0, sizeof(dev_name));
|
- ret = memset_s(dev_name, sizeof(dev_name), 0, sizeof(dev_name));
|
||||||
- if (ret != 0) {
|
- if (ret != 0) {
|
||||||
- lxcfs_error("%s\n", "Internal error: memset devname failed");
|
- lxcfs_error("%s\n", "Internal error: memset devname failed");
|
||||||
- rv = 0;
|
- rv = 0;
|
||||||
- goto err;
|
- goto err;
|
||||||
- }
|
- }
|
||||||
+ memset(dev_name, 0, sizeof(dev_name));
|
+ memset(dev_name, 0, sizeof(dev_name));
|
||||||
|
|
||||||
i = sscanf(line, "%u %u %llu %71s", &major, &minor, &blocks, dev_name);
|
i = sscanf(line, "%u %u %llu %71s", &major, &minor, &blocks, dev_name);
|
||||||
if (i != 4)
|
if (i != 4)
|
||||||
@@ -4562,12 +4543,7 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
@@ -4562,12 +4543,7 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
if (total_len > size )
|
if (total_len > size )
|
||||||
total_len = size;
|
total_len = size;
|
||||||
|
|
||||||
- ret = memcpy_s(buf, size, d->buf, total_len);
|
- ret = memcpy_s(buf, size, d->buf, total_len);
|
||||||
- if (ret != 0) {
|
- if (ret != 0) {
|
||||||
- lxcfs_error("%s\n", "Internal error: memcpy buf failed");
|
- lxcfs_error("%s\n", "Internal error: memcpy buf failed");
|
||||||
- rv = 0;
|
- rv = 0;
|
||||||
- goto err;
|
- goto err;
|
||||||
- }
|
- }
|
||||||
+ memcpy(buf, d->buf, total_len);
|
+ memcpy(buf, d->buf, total_len);
|
||||||
|
|
||||||
rv = total_len;
|
rv = total_len;
|
||||||
err:
|
err:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user