Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Aug 2010 00:56:27 +0000 (17:56 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Aug 2010 00:56:27 +0000 (17:56 -0700)
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  kconfig: Fix warning: ignoring return value of 'fgets'
  kconfig: Fix warning: ignoring return value of 'fwrite'
  nconfig: Fix segfault when menu is empty
  kconfig: fix tristate choice with minimal config
  kconfig: fix savedefconfig for tristate choices

1  2 
scripts/kconfig/conf.c

diff --combined scripts/kconfig/conf.c
index 274f2716b03e9d4b0a5865a86a09b11799359523,4f0ed5b3a75e30f5194092bb63731bcac1c1bb04..5b7c86ea43a1e3f27484ccfc83f8d2992ad548a4
@@@ -108,7 -108,7 +108,7 @@@ static int conf_askvalue(struct symbol 
                check_stdin();
        case oldaskconfig:
                fflush(stdout);
-               fgets(line, 128, stdin);
+               xfgets(line, 128, stdin);
                return 1;
        default:
                break;
@@@ -306,7 -306,7 +306,7 @@@ static int conf_choice(struct menu *men
                        check_stdin();
                case oldaskconfig:
                        fflush(stdout);
-                       fgets(line, 128, stdin);
+                       xfgets(line, 128, stdin);
                        strip(line);
                        if (line[0] == '?') {
                                print_help(menu);
@@@ -599,12 -599,12 +599,12 @@@ int main(int ac, char **av
                break;
        case savedefconfig:
                break;
 -      case oldconfig:
        case oldaskconfig:
                rootEntry = &rootmenu;
                conf(&rootmenu);
                input_mode = silentoldconfig;
                /* fall through */
 +      case oldconfig:
        case listnewconfig:
        case oldnoconfig:
        case silentoldconfig:
        }
        return 0;
  }
+ /*
+  * Helper function to facilitate fgets() by Jean Sacren.
+  */
+ void xfgets(str, size, in)
+       char *str;
+       int size;
+       FILE *in;
+ {
+       if (fgets(str, size, in) == NULL)
+               fprintf(stderr, "\nError in reading or end of file.\n");
+ }