/[baselayout]/trunk/src/fstabinfo.c
Gentoo

Diff of /trunk/src/fstabinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2931 Revision 2932
94 FILE *fp; 94 FILE *fp;
95 struct mntent *ent; 95 struct mntent *ent;
96#else 96#else
97 struct fstab *ent; 97 struct fstab *ent;
98#endif 98#endif
99 int result = EXIT_FAILURE; 99 int result = EXIT_SUCCESS;
100 char *token; 100 char *token;
101 int i; 101 int i;
102 int opt; 102 int opt;
103 int output = OUTPUT_FILE; 103 int output = OUTPUT_FILE;
104 char **files = NULL; 104 char **files = NULL;
160 } 160 }
161 161
162 while (optind < argc) 162 while (optind < argc)
163 rc_strlist_add (&files, argv[optind++]); 163 rc_strlist_add (&files, argv[optind++]);
164 164
165 if (! files) { 165 if (! files && ! filtered) {
166 if (filtered) {
167 if (! rc_is_env ("RC_QUIET", "yes"))
168 eerror ("%s: no matches found", argv[0]);
169 exit (EXIT_FAILURE);
170 }
171
172 START_ENT; 166 START_ENT;
173 while ((ent = GET_ENT)) 167 while ((ent = GET_ENT))
174 rc_strlist_add (&files, ENT_FILE (ent)); 168 rc_strlist_add (&files, ENT_FILE (ent));
175 END_ENT; 169 END_ENT;
176 170
180 174
181 /* Ensure we always display something */ 175 /* Ensure we always display something */
182 START_ENT; 176 START_ENT;
183 STRLIST_FOREACH (files, file, i) { 177 STRLIST_FOREACH (files, file, i) {
184 if (! (ent = GET_ENT_FILE (file))) { 178 if (! (ent = GET_ENT_FILE (file))) {
185 if (! rc_is_env ("RC_QUIET", "yes"))
186 eerror ("%s: no such entry `%s'", argv[0], file);
187 result = EXIT_FAILURE; 179 result = EXIT_FAILURE;
188 continue; 180 continue;
189 } 181 }
182
183 /* No point in outputting if quiet */
184 if (rc_is_env ("RC_QUIET", "yes"))
185 continue;
190 186
191 switch (output) { 187 switch (output) {
192 case OUTPUT_MOUNTCMD: 188 case OUTPUT_MOUNTCMD:
193 printf ("-o %s -t %s %s %s\n", ENT_OPTS (ent), ENT_TYPE (ent), 189 printf ("-o %s -t %s %s %s\n", ENT_OPTS (ent), ENT_TYPE (ent),
194 ENT_DEVICE (ent), ENT_FILE (ent)); 190 ENT_DEVICE (ent), ENT_FILE (ent));

Legend:
Removed from v.2931  
changed lines
  Added in v.2932

  ViewVC Help
Powered by ViewVC 1.1.20