[maemo-commits] [maemo-commits] r17410 - in projects/haf/trunk/dosfstools/debian: . patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Feb 13 10:42:26 EET 2009
Author: kihamala
Date: 2009-02-13 10:42:25 +0200 (Fri, 13 Feb 2009)
New Revision: 17410

Added:
   projects/haf/trunk/dosfstools/debian/patches/14-error_code.patch
   projects/haf/trunk/dosfstools/debian/patches/15-osso-memory.patch
   projects/haf/trunk/dosfstools/debian/patches/16-time_limit.patch
Modified:
   projects/haf/trunk/dosfstools/debian/changelog
   projects/haf/trunk/dosfstools/debian/patches/series
Log:
patches from Leonid


Modified: projects/haf/trunk/dosfstools/debian/changelog
===================================================================
--- projects/haf/trunk/dosfstools/debian/changelog	2009-02-12 15:16:07 UTC (rev 17409)
+++ projects/haf/trunk/dosfstools/debian/changelog	2009-02-13 08:42:25 UTC (rev 17410)
@@ -1,3 +1,10 @@
+dosfstools (3.0.1-1maemo2~unreleased) unstable; urgency=low
+
+  * Patches from Leonid for time-limited scan, osso-mem, and dosfsck exit code.
+    Fixes: NB#93140
+
+ -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Fri, 13 Feb 2009 10:20:08 +0200
+
 dosfstools (3.0.1-1maemo1) unstable; urgency=low
 
   Mika:

Added: projects/haf/trunk/dosfstools/debian/patches/14-error_code.patch
===================================================================
--- projects/haf/trunk/dosfstools/debian/patches/14-error_code.patch	2009-02-12 15:16:07 UTC (rev 17409)
+++ projects/haf/trunk/dosfstools/debian/patches/14-error_code.patch	2009-02-13 08:42:25 UTC (rev 17410)
@@ -0,0 +1,24 @@
+Index: dosfstools-3.0.1/src/dosfsck.c
+===================================================================
+--- dosfstools-3.0.1.orig/src/dosfsck.c	2009-02-04 17:21:24.000000000 +0200
++++ dosfstools-3.0.1/src/dosfsck.c	2009-02-04 17:29:22.000000000 +0200
+@@ -175,7 +175,7 @@
+ 
+     if (osso_mem_saw_enable(1024 * 1024 * megs_to_spare, 0, NULL, NULL)) {
+ 	printf("osso_mem_saw_enable failed\n");
+-	return 1;
++	return 2;
+     }
+ 
+     printf( "dosfsck " VERSION ", " VERSION_DATE ", FAT32, LFN\n" );
+@@ -216,8 +216,8 @@
+     printf( "%s: %u files, %lu/%lu clusters\n", argv[optind],
+ 	    n_files, fs.clusters - free_clusters, fs.clusters );
+ 
+-    fs_close(rw);
+-    return 0;
++    /* We return 1 in case of errors detected: changes happened or will happened */
++    return (fs_close(rw) ? 1 : 0);
+ }
+ 
+ /* Local Variables: */

Added: projects/haf/trunk/dosfstools/debian/patches/15-osso-memory.patch
===================================================================
--- projects/haf/trunk/dosfstools/debian/patches/15-osso-memory.patch	2009-02-12 15:16:07 UTC (rev 17409)
+++ projects/haf/trunk/dosfstools/debian/patches/15-osso-memory.patch	2009-02-13 08:42:25 UTC (rev 17410)
@@ -0,0 +1,57 @@
+Index: dosfstools-3.0.1/src/dosfsck.c
+===================================================================
+--- dosfstools-3.0.1.orig/src/dosfsck.c	2009-02-04 17:13:49.000000000 +0200
++++ dosfstools-3.0.1/src/dosfsck.c	2009-02-04 17:14:51.000000000 +0200
+@@ -70,7 +70,7 @@
+     fprintf(stderr,"  -V       perform a verification pass\n");
+     fprintf(stderr,"  -w       write changes to disk immediately\n");
+     fprintf(stderr,"  -y       same as -a, for compat with other *fsck\n");
+-    fprintf(stderr,"  -m       Maemo addition: MBs to spare in the system (default 30)\n");
++    fprintf(stderr,"  -m       Maemo addition: MBs to spare in the system under high threshold (default 0)\n");
+     exit(2);
+ }
+ 
+@@ -110,7 +110,7 @@
+     int rw,salvage_files,verify,c;
+ 	unsigned n_files_check=0, n_files_verify=0;
+     unsigned long free_clusters;
+-    int megs_to_spare = 30;
++    int megs_to_spare = 0;
+ 
+     rw = salvage_files = verify = 0;
+     interactive = 1;
+Index: dosfstools-3.0.1/src/osso-mem.c
+===================================================================
+--- dosfstools-3.0.1.orig/src/osso-mem.c	2009-02-04 17:13:49.000000000 +0200
++++ dosfstools-3.0.1/src/osso-mem.c	2009-02-04 17:13:57.000000000 +0200
+@@ -26,6 +26,7 @@
+  * Includes
+  * ========================================================================= */
+ 
++#include <osso-log.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -33,10 +34,8 @@
+ #include <errno.h>
+ #include <pthread.h>
+ #include <string.h>
+-#include <syslog.h>
+ #include <inttypes.h>
+ 
+-#include "osso-log.h"
+ #include "osso-mem.h"
+ 
+ 
+@@ -488,11 +487,6 @@
+       saw_max_heap_size  = mi.arena + mi.hblkhd + current.usable - threshold;
+       saw_max_block_size = watchblock;
+       saw_user_context   = context;
+-      /* Always dumping memory information (workaround for thumbnailer) */
+-      syslog(LOG_CRIT, "osso_mem %zd = %u + %u + %zd - %zd",
+-	     saw_max_heap_size, mi.arena, mi.hblkhd, current.usable, 
+-	     threshold);
+-
+       if(saw_malloc_hook != __malloc_hook)
+       {
+          /* SAW hook is not set */

Added: projects/haf/trunk/dosfstools/debian/patches/16-time_limit.patch
===================================================================
--- projects/haf/trunk/dosfstools/debian/patches/16-time_limit.patch	2009-02-12 15:16:07 UTC (rev 17409)
+++ projects/haf/trunk/dosfstools/debian/patches/16-time_limit.patch	2009-02-13 08:42:25 UTC (rev 17410)
@@ -0,0 +1,101 @@
+Index: dosfstools-3.0.1/src/common.c
+===================================================================
+--- dosfstools-3.0.1.orig/src/common.c	2009-02-04 17:40:40.000000000 +0200
++++ dosfstools-3.0.1/src/common.c	2009-02-04 18:05:15.000000000 +0200
+@@ -34,6 +34,10 @@
+ #include <stdarg.h>
+ #include <errno.h>
+ 
++#include <signal.h>
++#include <unistd.h>
++#include "io.h"
++
+ #include "common.h"
+ 
+ unsigned long checked_clusters = 0;
+@@ -176,6 +180,31 @@
+     }
+ }
+ 
++
++static void time_limit_handler(int signo)
++{
++    const int errors = fs_close(0);
++
++    printf("dosfsck: check time limit reached, file system errors are %sdetected\n", errors ? "" : "not ");
++    exit(errors ? 1 : 0);
++} /* time_limit_handler */
++
++int set_time_limit(int theLimit)
++{
++    /* Check parameters */
++    if (theLimit <= 0)
++	return 0;
++
++    if (SIG_ERR == signal(SIGALRM, time_limit_handler))
++        return 0;
++
++    /* Set the alarm for pointed time in seconds */
++    alarm( (unsigned)theLimit );
++
++    return 1;
++} /* set_time_limit */
++
++
+ /* Local Variables: */
+ /* tab-width: 8     */
+ /* End:             */
+Index: dosfstools-3.0.1/src/common.h
+===================================================================
+--- dosfstools-3.0.1.orig/src/common.h	2009-02-04 17:40:40.000000000 +0200
++++ dosfstools-3.0.1/src/common.h	2009-02-04 18:05:36.000000000 +0200
+@@ -54,4 +54,9 @@
+ /* Displays PROMPT and waits for user input. Only characters in VALID are
+    accepted. Terminates the program on EOF. Returns the character. */
+ 
++int set_time_limit(int theLimit);
++/* Set pointed time limit in seconds and enable alarm. When alarm raised
++   check the file system status and exits with result of check.
++   ATTENTION: shall not be used with write option */
++
+ #endif
+Index: dosfstools-3.0.1/src/dosfsck.c
+===================================================================
+--- dosfstools-3.0.1.orig/src/dosfsck.c	2009-02-04 17:35:06.000000000 +0200
++++ dosfstools-3.0.1/src/dosfsck.c	2009-02-04 18:03:04.000000000 +0200
+@@ -71,6 +71,7 @@
+     fprintf(stderr,"  -w       write changes to disk immediately\n");
+     fprintf(stderr,"  -y       same as -a, for compat with other *fsck\n");
+     fprintf(stderr,"  -m       Maemo addition: MBs to spare in the system under high threshold (default 0)\n");
++    fprintf(stderr,"  -T secs  Maemo addition: no-op time limited check for pointed duration\n");
+     exit(2);
+ }
+ 
+@@ -116,7 +117,7 @@
+     interactive = 1;
+     check_atari();
+ 
+-    while ((c = getopt(argc,argv,"Aad:flnprtu:vVwym:")) != EOF)
++    while ((c = getopt(argc,argv,"Aad:flnprtu:vVwym:T:")) != EOF)
+ 	switch (c) {
+ 	    case 'A': /* toggle Atari format */
+ 	  	atari_format = !atari_format;
+@@ -164,6 +165,18 @@
+ 	    case 'w':
+ 		write_immed = 1;
+ 		break;
++	    case 'T':
++		if ( set_time_limit( atoi(optarg) ) )
++                {
++		    rw = 0;
++		    printf("dosfsck: no-op time limited check mode selected\n");
++                }
++                else
++                {
++		    printf("dosfsck: problems during selection time limited check mode\n");
++                    return 2;
++                }
++		break;
+ 	    default:
+ 		usage(argv[0]);
+ 	}

Modified: projects/haf/trunk/dosfstools/debian/patches/series
===================================================================
--- projects/haf/trunk/dosfstools/debian/patches/series	2009-02-12 15:16:07 UTC (rev 17409)
+++ projects/haf/trunk/dosfstools/debian/patches/series	2009-02-13 08:42:25 UTC (rev 17410)
@@ -9,3 +9,6 @@
 11-ignore-fs_close-return-value.patch
 12-make-autorenaming-counter-static.patch
 13-dosfsck-alloc-errno.patch
+14-error_code.patch
+15-osso-memory.patch
+16-time_limit.patch


More information about the maemo-commits mailing list