[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 17/43: Replace bcopy with memcpy or memmove as appropriate.
From: |
Samuel Thibault |
Subject: |
[hurd] 17/43: Replace bcopy with memcpy or memmove as appropriate. |
Date: |
Mon, 11 Sep 2017 07:10:10 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit a2f64c2462282bb3cf1ad24044c97bb7d6b85e0d
Author: Justus Winter <address@hidden>
Date: Sat Aug 5 19:26:25 2017 +0200
Replace bcopy with memcpy or memmove as appropriate.
* boot/boot.c: Replace bcopy with memcpy or memmove as appropriate.
* exec/hashexec.c: Likewise.
* libps/proclist.c: Likewise, but also fix the amount of data copied.
* libps/procstat.c: Likewise.
* libps/spec.c: Likewise.
* libshouldbeinlibc/cacheq.c: Likewise.
* libshouldbeinlibc/idvec.c: Likewise.
* libshouldbeinlibc/timefmt.c: Likewise.
---
boot/boot.c | 2 +-
exec/hashexec.c | 2 +-
libps/proclist.c | 2 +-
libps/procstat.c | 10 +++++-----
libps/spec.c | 2 +-
libshouldbeinlibc/cacheq.c | 2 +-
libshouldbeinlibc/idvec.c | 6 +++---
libshouldbeinlibc/timefmt.c | 2 +-
8 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/boot/boot.c b/boot/boot.c
index 6fbc0ae..35577a8 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1198,7 +1198,7 @@ ds_device_read_inband (device_t device,
{
if (returned != data)
{
- bcopy (returned, (void *)data, *datalen);
+ memcpy ((void *)data, returned, *datalen);
munmap ((caddr_t) returned, *datalen);
}
return D_SUCCESS;
diff --git a/exec/hashexec.c b/exec/hashexec.c
index 6337f0a..68b4881 100644
--- a/exec/hashexec.c
+++ b/exec/hashexec.c
@@ -274,7 +274,7 @@ check_hashbang (struct execdata *e,
if (memchr (argv, '\0', argvlen) == NULL)
{
name = alloca (argvlen + 1);
- bcopy (argv, name, argvlen);
+ memcpy (name, argv, argvlen);
name[argvlen] = '\0';
}
else
diff --git a/libps/proclist.c b/libps/proclist.c
index 2201cad..4e2174a 100644
--- a/libps/proclist.c
+++ b/libps/proclist.c
@@ -68,7 +68,7 @@ proc_stat_list_clone (struct proc_stat_list *pp, struct
proc_stat_list **copy)
return ENOMEM;
}
- bcopy (pp->proc_stats, procs, pp->num_procs);
+ memcpy (procs, pp->proc_stats, sizeof *procs * pp->num_procs);
new->proc_stats = procs;
new->num_procs = pp->num_procs;
diff --git a/libps/procstat.c b/libps/procstat.c
index c6c3a44..f6420ee 100644
--- a/libps/procstat.c
+++ b/libps/procstat.c
@@ -224,12 +224,12 @@ merge_procinfo (struct proc_stat *ps, ps_flags_t need,
ps_flags_t have)
/* There was old information, try merging it. */
if (have & PSTAT_TASK_BASIC)
/* Task info. */
- bcopy (&old_pi_hdr.taskinfo, &new_pi->taskinfo,
- sizeof (struct task_basic_info));
+ memcpy (&new_pi->taskinfo, &old_pi_hdr.taskinfo,
+ sizeof (struct task_basic_info));
if (have & PSTAT_TASK_EVENTS)
/* Event info. */
- bcopy (&old_pi_hdr.taskevents, &new_pi->taskevents,
- sizeof (struct task_events_info));
+ memcpy (&new_pi->taskevents, &old_pi_hdr.taskevents,
+ sizeof (struct task_events_info));
/* That's it for now. */
if (new_pi != ps->proc_info)
@@ -604,7 +604,7 @@ clone (void *src, size_t size)
{
void *dst = malloc (size);
if (dst)
- bcopy (src, dst, size);
+ memcpy (dst, src, size);
return dst;
}
diff --git a/libps/spec.c b/libps/spec.c
index 4a6e226..5e540f8 100644
--- a/libps/spec.c
+++ b/libps/spec.c
@@ -1023,7 +1023,7 @@ specs_add_alias (struct ps_fmt_specs *specs,
exp->name = malloc (name_len + 1);
if (! exp->name)
return 0;
- bcopy ((char *)alias->name, (char *)exp->name, name_len);
+ memcpy ((char *)exp->name, (char *)alias->name, name_len);
((char *)exp->name)[name_len] = '\0';
/* Copy the rest of the fields from ALIAS, but defaulting to SRC. */
diff --git a/libshouldbeinlibc/cacheq.c b/libshouldbeinlibc/cacheq.c
index 5912f84..d3a7591 100644
--- a/libshouldbeinlibc/cacheq.c
+++ b/libshouldbeinlibc/cacheq.c
@@ -95,7 +95,7 @@ cacheq_set_length (struct cacheq *cq, int length)
(!th || th >= end) ? 0 : (void *)th + esz;
if (fh && th)
- bcopy (fh, th, esz); /* Copy the bits in a moved entry. */
+ memcpy (th, fh, esz); /* Copy the bits in a moved entry. */
else if (th)
memset (th, 0, esz); /* Zero the bits in a new entry. */
diff --git a/libshouldbeinlibc/idvec.c b/libshouldbeinlibc/idvec.c
index c60fc9f..63f59f6 100644
--- a/libshouldbeinlibc/idvec.c
+++ b/libshouldbeinlibc/idvec.c
@@ -113,7 +113,7 @@ idvec_insert (struct idvec *idvec, unsigned pos, uid_t id)
{
uid_t *ids = idvec->ids;
if (pos < num)
- bcopy (ids + pos, ids + pos + 1, (num - pos) * sizeof (uid_t));
+ memmove (ids + pos + 1, ids + pos, (num - pos) * sizeof (uid_t));
else if (pos > num)
memset (ids + num, 0, (pos - num) * sizeof(uid_t));
ids[pos] = id;
@@ -163,7 +163,7 @@ idvec_set_ids (struct idvec *idvec, const uid_t *ids,
unsigned num)
err = idvec_ensure (idvec, num);
if (!err)
{
- bcopy (ids, idvec->ids, num * sizeof (uid_t));
+ memcpy (idvec->ids, ids, num * sizeof (uid_t));
idvec->num = num;
}
return err;
@@ -279,7 +279,7 @@ idvec_delete (struct idvec *idvec, unsigned pos)
uid_t *ids = idvec->ids;
idvec->num = --num;
if (num > pos)
- bcopy (ids + pos + 1, ids + pos, (num - pos) * sizeof (uid_t));
+ memmove (ids + pos, ids + pos + 1, (num - pos) * sizeof (uid_t));
}
}
diff --git a/libshouldbeinlibc/timefmt.c b/libshouldbeinlibc/timefmt.c
index cef72e0..2bbeffc 100644
--- a/libshouldbeinlibc/timefmt.c
+++ b/libshouldbeinlibc/timefmt.c
@@ -296,7 +296,7 @@ fmt_past_time (struct timeval *tv, struct timeval *now,
if (diff < 0)
diff = -diff; /* XXX */
- bcopy (localtime ((time_t *) &tv->tv_sec), &tm, sizeof tm);
+ memcpy (&tm, localtime ((time_t *) &tv->tv_sec), sizeof tm);
if (width <= 0 || width >= buf_len)
width = buf_len - 1;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 35/43: libnetfs: Remove redundant type checks., (continued)
- [hurd] 35/43: libnetfs: Remove redundant type checks., Samuel Thibault, 2017/09/11
- [hurd] 26/43: eth-multiplexer: Remove local definiton., Samuel Thibault, 2017/09/11
- [hurd] 34/43: libdiskfs: Simplify type checks., Samuel Thibault, 2017/09/11
- [hurd] 16/43: Simplify deallocations., Samuel Thibault, 2017/09/11
- [hurd] 29/43: eth-multiplexer: Respect interfaces up flags., Samuel Thibault, 2017/09/11
- [hurd] 36/43: startup: Don't spin on host_reboot failures., Samuel Thibault, 2017/09/11
- [hurd] 30/43: Drop the register qualifier., Samuel Thibault, 2017/09/11
- [hurd] 02/43: trans: New random translator., Samuel Thibault, 2017/09/11
- [hurd] 43/43: storeio: Avoid calling mmap with zero size, Samuel Thibault, 2017/09/11
- [hurd] 03/43: trans: Conditionally build the random translator., Samuel Thibault, 2017/09/11
- [hurd] 17/43: Replace bcopy with memcpy or memmove as appropriate.,
Samuel Thibault <=
- [hurd] 42/43: Fix build with glibc-2.26, Samuel Thibault, 2017/09/11
- [hurd] 39/43: Remove unused parameter from the 'get_source' machinery., Samuel Thibault, 2017/09/11
- [hurd] 37/43: trans/symlink: Use default server stubs., Samuel Thibault, 2017/09/11
- [hurd] 40/43: pfinet: select UDP/TCP ports randomly, Samuel Thibault, 2017/09/11
- [hurd] 15/43: Use our own variant of 'assert' and 'assert_perror'., Samuel Thibault, 2017/09/11