Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 143868 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-6 / +19 lines)
Line  Link Here
0
-- orig/src/mon-text.c
0
++ mod/src/mon-text.c
Lines 36-42 Link Here
36
#include "exitcode.h"
36
#include "exitcode.h"
37
#include "snprintf.h"
37
#include "snprintf.h"
38
#include "mon.h"
38
#include "mon.h"
39
39
#include "time.h"
40
40
41
/**
41
/**
42
 * @file
42
 * @file
Lines 85-109 Link Here
85
     * other program, so make sure we're always line buffered. */
85
     * other program, so make sure we're always line buffered. */
86
    setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
86
    setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
87
87
88
    char currentTimeAsString[9];
89
88
    do {
90
    do {
89
        struct dcc_task_state *i;
91
        struct dcc_task_state *i;
90
        
92
        
91
        if ((ret = dcc_mon_poll(&list)))
93
        if ((ret = dcc_mon_poll(&list)))
92
            return ret;
94
            return ret;
93
95
96
        unsigned int havePrinted = 0;
97
94
        for (i = list; i; i = i->next) {
98
        for (i = list; i; i = i->next) {
95
#if 1
99
100
            havePrinted = 1;
101
96
            if (i->curr_phase == DCC_PHASE_DONE)
102
            if (i->curr_phase == DCC_PHASE_DONE)
97
                continue;
103
                continue;
98
#endif
104
105
            time_t currentTime;
106
            time(&currentTime);
107
108
            strftime(currentTimeAsString, 9, "%H:%M:%S", localtime(&currentTime));
109
99
            /* Assume 80 cols = */
110
            /* Assume 80 cols = */
100
            printf("%6ld  %-10.10s  %-30.30s %24.24s[%d]\n",
111
            printf("[%8s] %6ld  %-10.10s  %-30.30s %24.24s[%d]\n",
112
                    currentTimeAsString,
101
                   (long) i->cpid,
113
                   (long) i->cpid,
102
                   dcc_get_phase_name(i->curr_phase),
114
                   dcc_get_phase_name(i->curr_phase),
103
                   i->file, i->host, i->slot);
115
                   i->file, i->host, i->slot);
104
        }
116
        }
105
117
106
        printf("\n");
118
        if(havePrinted)
119
            printf("\n");
107
120
108
        /* XXX: usleep() is probably not very portable */
121
        /* XXX: usleep() is probably not very portable */
109
        usleep(delay * 1000000);
122
        usleep(delay * 1000000);

Return to bug 143868