mem2swap.c
changeset 48 b94d657a9acb
parent 29 7abf6146898e
child 51 a03372ef9714
equal deleted inserted replaced
47:63adb261de90 48:b94d657a9acb
    42         printf ("Report bugs to mbroeker@largo.homelinux.org\n");
    42         printf ("Report bugs to mbroeker@largo.homelinux.org\n");
    43         return EXIT_FAILURE;
    43         return EXIT_FAILURE;
    44     }
    44     }
    45 
    45 
    46     if ((p = malloc (N * size)) == NULL)
    46     if ((p = malloc (N * size)) == NULL)
    47         return EXIT_SUCCESS;
    47         return EXIT_FAILURE;
    48 
    48 
    49     while (1) {
    49     for (;;) {
    50         for (i = 0; i < N; i++) {
    50         for (i = 0; i < N; i++) {
    51             p[n * N + i] = size * (n * N + i);
    51             p[n * N + i] = size * (n * N + i);
    52         }
    52         }
    53         if ((p_new = realloc (p, (++n + 1) * N * size)))
    53         if ((p_new = realloc (p, (++n + 1) * N * size)))
    54             p = p_new;
    54             p = p_new;