apply.c 487 B

123456789101112131415161718192021222324252627
  1. #include "sandbox.h"
  2. #include <stdlib.h>
  3. #include <string.h>
  4. void sandbox_apply(struct s_sandboxenv *env)
  5. {
  6. apply_fs(env);
  7. }
  8. void prompt_sandbox(struct s_sandboxenv *env)
  9. {
  10. char *c = NULL;
  11. size_t size;
  12. do
  13. {
  14. if (c)
  15. free(c);
  16. c = NULL;
  17. printf("Apply (a) / Cancel (c) changes ?\n");
  18. getline(&c, &size, stdin);
  19. } while (strcmp("a\n", c) && strcmp("c\n", c));
  20. if (*c == 'c')
  21. return;
  22. sandbox_apply(env);
  23. }