From max at tyndur.org Fri Apr 12 15:45:14 2013 From: max at tyndur.org (max at tyndur.org) Date: Fri, 12 Apr 2013 15:45:14 +0200 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_soft-and-slow=3A_get=5Ftick?= =?utf-8?b?X2NvdW50KCkgZsO8ciBnZWFycw==?= Message-ID: <1365774314-25402-1-git-send-email-max@tyndur.org> From: Max Reitz + týndur hat zwar kein gettimeofday, aber get_tick_count reicht hier völlig aus. Signed-off-by: Max Reitz --- lbuilds/soft-and-slow/master/patches/gears.patch | 72 ++++++------------------ 1 file changed, 18 insertions(+), 54 deletions(-) diff --git a/lbuilds/soft-and-slow/master/patches/gears.patch b/lbuilds/soft-and-slow/master/patches/gears.patch index 93a2539..ef3021e 100644 --- a/lbuilds/soft-and-slow/master/patches/gears.patch +++ b/lbuilds/soft-and-slow/master/patches/gears.patch @@ -1,7 +1,7 @@ Index: src/soft-and-slow-master/test/gears/Makefile =================================================================== ---- src.orig/soft-and-slow-master/test/gears/Makefile 2011-09-13 22:35:20.000000000 +0200 -+++ src/soft-and-slow-master/test/gears/Makefile 2011-09-13 22:41:11.000000000 +0200 +--- src.orig/soft-and-slow-master/test/gears/Makefile ++++ src/soft-and-slow-master/test/gears/Makefile @@ -1,8 +1,6 @@ -CC = gcc -LINK = gcc @@ -15,17 +15,9 @@ Index: src/soft-and-slow-master/test/gears/Makefile Index: src/soft-and-slow-master/test/gears/gears.c =================================================================== ---- src.orig/soft-and-slow-master/test/gears/gears.c 2011-09-13 20:41:00.000000000 +0200 -+++ src/soft-and-slow-master/test/gears/gears.c 2011-09-13 23:56:08.000000000 +0200 -@@ -3,7 +3,6 @@ - * - * Command line options: - * -info print GL implementation information -- * -exit automatically exit after 30 seconds - * - * - * Brian Paul -@@ -17,6 +16,8 @@ +--- src.orig/soft-and-slow-master/test/gears/gears.c ++++ src/soft-and-slow-master/test/gears/gears.c +@@ -17,12 +17,14 @@ #include #include @@ -34,52 +26,27 @@ Index: src/soft-and-slow-master/test/gears/gears.c #include #include #include -@@ -32,17 +33,16 @@ + #include - static GLint T0 = 0; - static GLint Frames = 0; --static GLint autoexit = 0; - static GLfloat viewDist = 40.0; +-#include ++#include + #include + +@@ -38,11 +40,7 @@ static GLfloat viewDist = 40.0; static long elapsed_time(void) { - static struct timeval tv; -+ static long time = 0; - -- gettimeofday(&tv, NULL); -+ time += 29; - -- return tv.tv_sec * 1000 + tv.tv_usec / 1000; -+ return time; - } - - -@@ -221,23 +221,6 @@ - glPopMatrix(); - - glPopMatrix(); - -- Frames++; +- gettimeofday(&tv, NULL); - -- { -- GLint t = elapsed_time(); -- if (t - T0 >= 5000) { -- GLfloat seconds = (t - T0) / 1000.0; -- GLfloat fps = Frames / seconds; -- printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); -- fflush(stdout); -- T0 = t; -- Frames = 0; -- if ((t >= 999.0 * autoexit) && (autoexit)) { -- exit(0); -- } -- } -- } +- return tv.tv_sec * 1000 + tv.tv_usec / 1000; ++ return get_tick_count() / 1000; } -@@ -282,7 +265,7 @@ +@@ -282,7 +280,7 @@ init (int argc, char *argv[]) glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -88,7 +55,7 @@ Index: src/soft-and-slow-master/test/gears/gears.c glMatrixMode(GL_MODELVIEW); -@@ -304,10 +287,10 @@ +@@ -304,10 +302,10 @@ int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO); @@ -101,7 +68,7 @@ Index: src/soft-and-slow-master/test/gears/gears.c set_current_sas_context(ctx); init(argc, argv); -@@ -337,7 +320,7 @@ +@@ -337,7 +335,7 @@ int main(int argc, char *argv[]) SDL_Event evt; while (SDL_PollEvent(&evt)) @@ -110,14 +77,11 @@ Index: src/soft-and-slow-master/test/gears/gears.c quit = 1; } -@@ -346,5 +329,10 @@ +@@ -346,5 +344,7 @@ int main(int argc, char *argv[]) destroy_sas_context(ctx); + SDL_Quit(); + -+ libvideo_destroy_bitmap(libvideo_get_frontbuffer_bitmap(0)); -+ libvideo_restore_text_mode(); -+ return 0; } -- 1.8.2.1 From kevin at tyndur.org Sat Apr 13 13:22:07 2013 From: kevin at tyndur.org (Kevin Wolf) Date: Sat, 13 Apr 2013 13:22:07 +0200 Subject: [tyndur-devel] =?iso-8859-1?q?=5BPATCH=5D_soft-and-slow=3A_get=5F?= =?iso-8859-1?q?tick=5Fcount=28=29_f=FCr_gears?= In-Reply-To: <1365774314-25402-1-git-send-email-max@tyndur.org> References: <1365774314-25402-1-git-send-email-max@tyndur.org> Message-ID: <20130413112207.GA6590@silvanus> On Fri, Apr 12, 2013 at 03:45:14PM +0200, max at tyndur.org wrote: > From: Max Reitz > > + týndur hat zwar kein gettimeofday, aber get_tick_count reicht hier > völlig aus. > > Signed-off-by: Max Reitz Sieht gut aus, schieb's rein. Kevin From kevin at tyndur.org Sat Apr 13 13:33:47 2013 From: kevin at tyndur.org (Kevin Wolf) Date: Sat, 13 Apr 2013 13:33:47 +0200 Subject: [tyndur-devel] [PATCH] neuer shell-Befehl: killall In-Reply-To: <1364420817-15812-1-git-send-email-particleflux@gmail.com> References: <1364420817-15812-1-git-send-email-particleflux@gmail.com> Message-ID: <20130413113347.GB6590@silvanus> On Wed, Mar 27, 2013 at 10:46:57PM +0100, Stefan Linke wrote: > + Neuen Shell-Befehl killall implementiert, der alle Prozesse mit gegebenem Namen killt. > > Signed-off-by: Stefan Linke Ich habe das jetzt mal so gepusht, aber es gibt noch an ein paar Stellen Möglichkeiten, nachzuarbeiten. ;-) > +#ifdef CONFIG_SHELL_BUILTIN_ONLY > + int shell_command_killall(int argc, char* argv[], const char* args) > +#else > + int main(int argc, char* argv[]) > +#endif > +{ > + int ret=0,i=0,fail=0,matches=0; > + task_info_t *task_info = NULL; > + char *process; > + char copied_cmdline[255]; > + > + if (argc < 2) { > + killall_display_usage(); > + return -1; > + } > + > + task_info = enumerate_tasks(); > + > + if (task_info == NULL) { > + return EXIT_FAILURE; > + } > + > + > + for (i = 0; i < task_info->task_count; ++i) { > + strncpy(copied_cmdline, task_info->tasks[i].cmdline, 255); copied_cmdline ist nicht nullterminiert, wenn der String zu lang war. > + > + process = strtok((char *) task_info->tasks[i].cmdline, " "); > + process = process == NULL > + ? strrchr(task_info->tasks[i].cmdline, '/') > + : strrchr(process, '/'); > + ++process; Wenn kein / in der Kommandozeile vorkommt, hast du ein Problem. > + > + if (strcmp(argv[1], process) == 0) { > + ++matches; > + ret = kill(task_info->tasks[i].pid, SIGTERM); > + > + if (ret < 0) { > + printf(TMS(killall_cant_kill, > + "Konnte pid %d - %s nicht beenden: %s (%s)\n"), > + task_info->tasks[i].pid, errno, strerror(errno)); > + > + if (!fail) { > + fail = 1; > + } Das if ist eigentlich ziemlich überflüssig. Wenn du eine 1 mit noch einer 1 überschreibst, passiert auch nichts schlimmes. Kevin From hartmut at tyndur.org Sun Apr 21 06:18:00 2013 From: hartmut at tyndur.org (Alexander Kluth) Date: Sun, 21 Apr 2013 06:18:00 +0200 Subject: [tyndur-devel] =?utf-8?q?=5BPATCH=5D_vim_Swap-Files_zur_gitignore?= =?utf-8?q?_hinzugef=C3=BCgt?= Message-ID: <1366517880-5455-1-git-send-email-hartmut@tyndur.org> + .gitignore: *.swp und *.swo hinzugefügt Signed-off-by: Alexander Kluth --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5038655..a75f36d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ ppas.sh /build/output *.patch qemu-serial.log +*.swp +*.swo -- 1.8.2.1