Replace deprecated bcopy() by memmove()
Chocobo1 committed
Sep 25, 2016 at 18:32 UTC
0d4ee190ec0a2eeb957404ed29ab3ac38786c545
3 files changed
+9
-9
src/apps_plugin.c
+7
-7
@@ -518,7 +518,7 @@ void del_pid_entry(pid_t pid) {
518
// update pids from proc
519
520
int read_proc_pid_cmdline(struct pid_stat *p) {
521
-
521
+
522
if(unlikely(!p->cmdline_filename)) {
523
char filename[FILENAME_MAX + 1];
524
snprintfz(filename, FILENAME_MAX, "%s/proc/%d/cmdline", global_host_prefix, p->pid);
@@ -1273,14 +1273,14 @@ void find_lost_child_debug(struct pid_stat *pe, unsigned long long lost, int typ
1273
found++;
1274
}
1275
break;
1276
-
1276
+
1277
case 2:
1278
if(p->cmajflt > lost) {
1279
fprintf(stderr, " > process %d (%s) could use the lost exited child majflt %llu of process %d (%s)\n", p->pid, p->comm, lost, pe->pid, pe->comm);
1280
found++;
1281
}
1282
break;
1283
-
1283
+
1284
case 3:
1285
if(p->cutime > lost) {
1286
fprintf(stderr, " > process %d (%s) could use the lost exited child utime %llu of process %d (%s)\n", p->pid, p->comm, lost, pe->pid, pe->comm);
@@ -1309,11 +1309,11 @@ void find_lost_child_debug(struct pid_stat *pe, unsigned long long lost, int typ
1309
case 1:
1310
fprintf(stderr, " > cannot find any process to use the lost exited child minflt %llu of process %d (%s)\n", lost, pe->pid, pe->comm);
1311
break;
1312
-
1312
+
1313
case 2:
1314
fprintf(stderr, " > cannot find any process to use the lost exited child majflt %llu of process %d (%s)\n", lost, pe->pid, pe->comm);
1315
break;
1316
-
1316
+
1317
case 3:
1318
fprintf(stderr, " > cannot find any process to use the lost exited child utime %llu of process %d (%s)\n", lost, pe->pid, pe->comm);
1319
break;
@@ -2175,8 +2175,8 @@ unsigned long long send_resource_usage_to_netdata() {
2175
cpuuser = me.ru_utime.tv_sec * 1000000ULL + me.ru_utime.tv_usec;
2176
cpusyst = me.ru_stime.tv_sec * 1000000ULL + me.ru_stime.tv_usec;
2177
2178
- bcopy(&now, &last, sizeof(struct timeval));
2179
- bcopy(&me, &me_last, sizeof(struct rusage));
2178
+ memmove(&last, &now, sizeof(struct timeval));
2179
+ memmove(&me_last, &me, sizeof(struct rusage));
2180
}
2181
2182
buffer_sprintf(output,
src/plugin_nfacct.c
+1
-1
@@ -188,7 +188,7 @@ void *nfacct_main(void *ptr) {
188
usleep(susec);
189
190
// copy current to last
191
- bcopy(&now, &last, sizeof(struct timeval));
191
+ memmove(&last, &now, sizeof(struct timeval));
192
}
193
194
mnl_socket_close(nl);
src/plugins_d.c
+1
-1
@@ -358,7 +358,7 @@ void *pluginsd_worker_thread(void *arg)
358
error("PLUGINSD: %s sleeping for %llu. Will kill with SIGCONT pid %d to wake it up.\n", cd->fullfilename, susec, cd->pid);
359
usleep(susec);
360
killpid(cd->pid, SIGCONT);
361
- bcopy(&now, &last, sizeof(struct timeval));
361
+ memmove(&last, &now, sizeof(struct timeval));
362
break;
363
}
364
#endif