This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 727d637ad22f615be1b18741e3efd9a829dfed2b (commit) from c86751325f6076b6ea840a1a689b99e30f6c35ca (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/727d637ad22f615be1b18741e3efd9a829dfe...
commit 727d637ad22f615be1b18741e3efd9a829dfed2b Author: Cyril Hrubis metan@ucw.cz Date: Sat Oct 13 17:12:42 2012 +0200
tests: framework: A little cleanup.
diff --git a/tests/framework/tst_job.c b/tests/framework/tst_job.c index c02fa9f..ad71ba8 100644 --- a/tests/framework/tst_job.c +++ b/tests/framework/tst_job.c @@ -60,7 +60,7 @@ void tst_diff_timespec(int *sec, int *nsec, struct timespec *start, } }
-#define NAME_PADD 23 +#define NAME_PADD 21
static void stop_test(struct tst_job *job) { @@ -109,7 +109,7 @@ static void stop_test(struct tst_job *job) for (i = strlen(name); i < NAME_PADD; i++) fprintf(stderr, " ");
- fprintf(stderr, " finished (Time %2i.%03is, CPU %2i.%03is) %sn", + fprintf(stderr, " finished (Time %3i.%03is, CPU %3i.%03is) %sn", sec, nsec/1000000, (int)job->cpu_time.tv_sec, (int)job->cpu_time.tv_nsec/1000000, @@ -215,14 +215,12 @@ static void prepare_tmpdir(const char *name, const char *res_path, static void write_timespec(struct tst_job *job, char type, struct timespec *time) { - char buf[1 + sizeof(time_t) + sizeof(long)]; + char buf[1 + sizeof(struct timespec)]; char *ptr = buf;
*(ptr++) = type; - - *((time_t*)ptr) = time->tv_sec; - ptr += sizeof(time_t); - *((long*)ptr) = time->tv_nsec; + + memcpy(ptr, time, sizeof(*time));
if (write(job->pipefd, buf, sizeof(buf)) != sizeof(buf)) tst_warn("write(timespec) failed: %s", strerror(errno)); @@ -233,15 +231,14 @@ static void write_timespec(struct tst_job *job, char type, */ static void read_timespec(struct tst_job *job, struct timespec *time) { - char buf[sizeof(time_t) + sizeof(long)]; - char *ptr = buf; + int ret;
- if (read(job->pipefd, buf, sizeof(buf)) != sizeof(buf)) - tst_warn("read(timespec) failed: %s", strerror(errno)); + do { + ret = read(job->pipefd, time, sizeof(*time)); + } while (ret == 0);
- time->tv_sec = *((time_t*)ptr); - ptr += sizeof(time_t); - time->tv_nsec = *(long*)(ptr); + if (ret < 0 || ret != sizeof(*time)) + tst_warn("read(timespec) failed: %s", strerror(errno)); }
static void child_write(struct tst_job *job, char ch, void *ptr, ssize_t size)
-----------------------------------------------------------------------
Summary of changes: tests/framework/tst_job.c | 25 +++++++++++-------------- 1 files changed, 11 insertions(+), 14 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.