diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-07 17:49:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-07 17:49:10 +0000 |
commit | 23f103db87f8567814a1ec9ebdbb090e881ea32d (patch) | |
tree | 7a3adf5c44cbb84148b4185101696ceb46909da2 /src/util | |
parent | 0663a057d7611270d5f41ae8b345125d737387f2 (diff) | |
download | gnunet-23f103db87f8567814a1ec9ebdbb090e881ea32d.tar.gz gnunet-23f103db87f8567814a1ec9ebdbb090e881ea32d.zip |
LRN: Small janitor fixes
* Prevent janitor from failing if a process can't be killed (it might be dead
by the time janitor gets around to killing it).
* Fix janitor messages about killing arm/non-arm processes
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_allocation.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index ad74727bc..98c89d86a 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -332,4 +332,25 @@ GNUNET_snprintf (char *buf, size_t size, const char *format, ...) | |||
332 | return ret; | 332 | return ret; |
333 | } | 333 | } |
334 | 334 | ||
335 | |||
336 | /** | ||
337 | * Create a copy of the given message. | ||
338 | * | ||
339 | * @param msg message to copy | ||
340 | * @return duplicate of the message | ||
341 | */ | ||
342 | struct GNUNET_MessageHeader * | ||
343 | GNUNET_copy_message (const struct GNUNET_MessageHeader *msg) | ||
344 | { | ||
345 | struct GNUNET_MessageHeader *ret; | ||
346 | uint16_t msize; | ||
347 | |||
348 | msize = ntohs (msg->size); | ||
349 | GNUNET_assert (msize >= sizeof (struct GNUNET_MessageHeader)); | ||
350 | ret = GNUNET_malloc (msize); | ||
351 | memcpy (ret, msg, msize); | ||
352 | return ret; | ||
353 | } | ||
354 | |||
355 | |||
335 | /* end of common_allocation.c */ | 356 | /* end of common_allocation.c */ |