修改return值和编译依赖
This commit is contained in:
parent
ee4b4d485b
commit
6c9b8e0511
|
@ -20,7 +20,8 @@ Build-Depends: debhelper-compat (= 12),
|
|||
libopencv-dev,
|
||||
libarchive-dev,
|
||||
libtesseract-dev,
|
||||
libpython3.8-dev
|
||||
libpython3.8-dev,
|
||||
libxrandr-dev
|
||||
Standards-Version: 4.4.1
|
||||
Homepage: http://gitlab2.kylin.com/kysdk/kysdk-system
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ float kdk_get_process_mem_usage_percent(int proc_num)
|
|||
|
||||
FILE *fp = fopen(path, "rt");
|
||||
if (!fp)
|
||||
return 0;
|
||||
return 0.00;
|
||||
|
||||
char buffer[1025];
|
||||
char buffers[1025];
|
||||
|
@ -227,7 +227,7 @@ char *kdk_get_process_status(int proc_num)
|
|||
|
||||
FILE *fp = fopen(path, "rt");
|
||||
if (!fp)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
char buffer[1025];
|
||||
|
||||
|
@ -353,7 +353,7 @@ char* kdk_get_process_start_time(int proc_num)
|
|||
t = fgets(tt, sizeof(tt), fpstat);
|
||||
if (sscanf(t , "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d %*d %*d %*d %*d %*d %19llu %*u", &time1) == EOF) {
|
||||
fclose(fpstat);
|
||||
return -1;
|
||||
return NULL;
|
||||
}
|
||||
fclose(fpstat);
|
||||
time_t now;
|
||||
|
@ -409,7 +409,7 @@ char* kdk_get_process_running_time(int proc_num)
|
|||
t = fgets(tt, sizeof(tt), fpstat);
|
||||
if (sscanf(t , "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d %*d %*d %*d %*d %*d %19llu %*u", &time1) == EOF) {
|
||||
fclose(fpstat);
|
||||
return -1;
|
||||
return NULL;
|
||||
}
|
||||
fclose(fpstat);
|
||||
|
||||
|
@ -487,15 +487,15 @@ char* kdk_get_process_command(int proc_num)
|
|||
char line[1024] = {0};
|
||||
|
||||
if (proc_num < 0 )
|
||||
return -1;
|
||||
return NULL;
|
||||
else
|
||||
sprintf(path, "/proc/%d/cmdline", proc_num);
|
||||
|
||||
if (strstr(path, "../"))
|
||||
return -1;
|
||||
return NULL;
|
||||
|
||||
if ((fd = fopen(path, "r")) == NULL) {
|
||||
return -1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int c;
|
||||
|
@ -812,7 +812,7 @@ int get_proc_uid(pid_t pid, char *proc_uid)
|
|||
|
||||
|
||||
if ((fpprocstat = fopen(procstatf, "r")) == NULL)
|
||||
return NULL;
|
||||
return -1;
|
||||
|
||||
while (fgets(line, sizeof(line), fpprocstat) != NULL) {
|
||||
if (lookup(line, "Uid", &name))
|
||||
|
@ -827,7 +827,7 @@ int get_proc_uid(pid_t pid, char *proc_uid)
|
|||
p = strtok(NULL," ");
|
||||
}
|
||||
if ((fp = fopen("/etc/passwd", "r")) == NULL)
|
||||
return NULL;
|
||||
return -1;
|
||||
|
||||
while (fgets(buff, sizeof(buff), fp) != NULL) {
|
||||
if(strstr(buff, buf[1]))
|
||||
|
@ -1036,7 +1036,7 @@ int get_proc_running_time(pid_t pid, char *proc_time)
|
|||
sprintf(path, "/proc/%d/stat", pid);
|
||||
FILE *fpstat = fopen(path, "r");
|
||||
if (fpstat == NULL) {
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
t = fgets(tt, sizeof(tt), fpstat);
|
||||
|
|
|
@ -890,7 +890,7 @@ char** kdk_system_get_resolving_power()
|
|||
|
||||
dirfd = opendir("/sys/class/drm");
|
||||
if (! dirfd) {
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
while ((direfd = readdir(dirfd))) {
|
||||
strcpy(temp, info->name);
|
||||
|
@ -907,7 +907,7 @@ char** kdk_system_get_resolving_power()
|
|||
fp = fopen(path, "r");
|
||||
if(fp == NULL)
|
||||
{
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
memset(mode,0,200*sizeof(char));
|
||||
while(fgets(buf, BUF_SIZE-1, fp)){
|
||||
|
|
Loading…
Reference in New Issue