]> arthur.barton.de Git - netdata.git/commitdiff
Replace deprecated bcopy() by memmove()
authorChocobo1 <Chocobo1@users.noreply.github.com>
Sun, 25 Sep 2016 10:32:46 +0000 (18:32 +0800)
committerChocobo1 <Chocobo1@users.noreply.github.com>
Mon, 26 Sep 2016 03:40:54 +0000 (11:40 +0800)
src/apps_plugin.c
src/plugin_nfacct.c
src/plugins_d.c

index 59c27e6208034e8d826013b8e97e13290b15084c..31899eac7babde120c8629ec26e580b66918291d 100644 (file)
@@ -518,7 +518,7 @@ void del_pid_entry(pid_t pid) {
 // update pids from proc
 
 int read_proc_pid_cmdline(struct pid_stat *p) {
-    
+
     if(unlikely(!p->cmdline_filename)) {
         char filename[FILENAME_MAX + 1];
         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
                     found++;
                 }
                 break;
-                
+
             case 2:
                 if(p->cmajflt > lost) {
                     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);
                     found++;
                 }
                 break;
-                
+
             case 3:
                 if(p->cutime > lost) {
                     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
             case 1:
                 fprintf(stderr, " > cannot find any process to use the lost exited child minflt %llu of process %d (%s)\n", lost, pe->pid, pe->comm);
                 break;
-                
+
             case 2:
                 fprintf(stderr, " > cannot find any process to use the lost exited child majflt %llu of process %d (%s)\n", lost, pe->pid, pe->comm);
                 break;
-                
+
             case 3:
                 fprintf(stderr, " > cannot find any process to use the lost exited child utime %llu of process %d (%s)\n", lost, pe->pid, pe->comm);
                 break;
@@ -2175,8 +2175,8 @@ unsigned long long send_resource_usage_to_netdata() {
         cpuuser = me.ru_utime.tv_sec * 1000000ULL + me.ru_utime.tv_usec;
         cpusyst = me.ru_stime.tv_sec * 1000000ULL + me.ru_stime.tv_usec;
 
-        bcopy(&now, &last, sizeof(struct timeval));
-        bcopy(&me, &me_last, sizeof(struct rusage));
+        memmove(&last, &now, sizeof(struct timeval));
+        memmove(&me_last, &me, sizeof(struct rusage));
     }
 
     buffer_sprintf(output,
index e513e5d0e7a09ab37b262159d7220de428d21ba5..7843161d32bf86e3bce565cf742e2dd3bfbfce97 100644 (file)
@@ -188,7 +188,7 @@ void *nfacct_main(void *ptr) {
         usleep(susec);
 
         // copy current to last
-        bcopy(&now, &last, sizeof(struct timeval));
+        memmove(&last, &now, sizeof(struct timeval));
     }
 
     mnl_socket_close(nl);
index 627cc90e5f443543c6f42382d26d7ab3b692db88..55ccd544389f092abe849625d51487a373eb03e6 100644 (file)
@@ -358,7 +358,7 @@ void *pluginsd_worker_thread(void *arg)
                 error("PLUGINSD: %s sleeping for %llu. Will kill with SIGCONT pid %d to wake it up.\n", cd->fullfilename, susec, cd->pid);
                 usleep(susec);
                 killpid(cd->pid, SIGCONT);
-                bcopy(&now, &last, sizeof(struct timeval));
+                memmove(&last, &now, sizeof(struct timeval));
                 break;
             }
 #endif