* imported qemu/hotfix-glibc-2.41.patch
[t2sde.git] / package / shells / kiss / mount_typo_features.patch
blobc35747bf5f75aa2ecb561c1f7d7cf71496f1eb6e
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../kiss/mount_typo_features.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 It's pretty weird to mount a directory at a device
18 - Alejandro
20 And a implemented 'read-only' mount option is even nicer - as well
21 as a remount possibility in rescue conditions ;-)
23 - Rene Rebe <rene@exactcode.de>
25 --- ./src/domount.c 1998-09-25 14:07:09.000000000 +0200
26 +++ ./src/domount.c 2003-12-24 16:16:17.000000000 +0100
27 @@ -2,27 +2,34 @@
29 int domount (Stringstack s)
31 - register int
32 - opt;
33 - register char
34 - *type = NULL;
35 + int opt;
36 + char *type = NULL;
37 + int mount_opt = 0;
39 - while ( (opt = getopt (s.nstr, s.str, "t:h")) != -1 )
40 + while ( (opt = getopt (s.nstr, s.str, "t:hrR")) != -1 )
41 switch (opt)
43 case 't':
44 if (! (type = optarg))
45 error ("missing type after \"-t\"");
46 break;
47 + case 'r':
48 + mount_opt |= MS_RDONLY;
49 + break;
50 + case 'R':
51 + mount_opt |= MS_REMOUNT;
52 + break;
53 default:
54 case 'h':
55 error ("Bad commandline.\n"
56 "Usage: %s\n"
57 - " or: %s [-t type] [-r] device directory\n"
58 + " or: %s [-t type] [-r] [-R] device directory\n"
59 "Where:\n"
60 " -t type : mount as type, e.g. ext2, minix\n"
61 " device : device to mount\n"
62 " directory : mount point\n"
63 + " -r : mount read-only\n"
64 + " -R : remount\n"
65 , progname, progname);
68 @@ -49,9 +56,9 @@
69 if (! type)
70 error ("need \"-t type\" specification");
72 - if (mount (s.str [optind], s.str [optind + 1], type, 1, 0))
73 - error ("problem mounting \"%s\" on \"%s\" (type \"%s\")",
74 - s.str [optind + 1], s.str [optind], type);
75 + if (mount (s.str [optind], s.str [optind + 1], type, mount_opt, 0))
76 + error ("problem mounting \"%s\" on \"%s\" (type \"%s\", opts \"%x\")",
77 + s.str [optind], s.str [optind + 1], type, mount_opt);
79 if (! (mtab = fopen (MTAB, "a")) )
80 return (warning ("\"%s\" not updated", MTAB));