diff options
-rw-r--r-- | src/nukectl.c | 6 | ||||
-rw-r--r-- | src/output_redirect.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nukectl.c b/src/nukectl.c index 3ee3bc5..de6b28d 100644 --- a/src/nukectl.c +++ b/src/nukectl.c @@ -59,6 +59,8 @@ void ignore_device(char** list, nndevice_t** d) void* wipe(void* device) { + extern WINDOW* main_window, *info_window; + extern pthread_mutex_t main_window_lock; nndevice_t* d = (nndevice_t*)device; unsigned long long times = 0; unsigned long long block = 0; @@ -91,7 +93,9 @@ void* wipe(void* device) if(verbose_flag) { percent = (long double)((bytes_out / (long double)d->sz) * 100); - printf("%s: %llu of %llu (%0.2Lf%%)\n", d->path, bytes_out, d->sz, percent); + //COM(self, "%s: %llu of %llu (%0.2Lf%%)\n", d->path, bytes_out, d->sz, percent); + mvwprintw(info_window, 0, 0, "%s: %llu of %llu (%0.2Lf%%)\n", d->path, bytes_out, d->sz, percent); + wrefresh(info_window); } bytes_out += nnwrite(fd, d->blksz); block++; diff --git a/src/output_redirect.c b/src/output_redirect.c index 8384270..f29bbea 100644 --- a/src/output_redirect.c +++ b/src/output_redirect.c @@ -25,6 +25,7 @@ #include <unistd.h> #include <errno.h> #include <time.h> +#include <pthread.h> #include "netnuke.h" extern int logging_flag; @@ -40,9 +41,10 @@ int nnlogcleanup() return status; } +extern WINDOW* main_window; +extern pthread_mutex_t main_window_lock; int COM(const char* func, char *format, ...) { - extern WINDOW* main_window; struct tm *logtm; time_t logtime = time(NULL); char timestr[64]; |