1d_fd_simple_shear

continuum model for granular flows with pore-pressure dynamics
git clone git://src.adamsgaard.dk/1d_fd_simple_shear
Log | Files | Refs | README | LICENSE

commit c69ce5e644c9313ff845d2798fa9a73b6c943d06
parent fac32c7a7febb4dcc3aea5968ee0255046f60ccc
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 13 Nov 2019 16:16:33 +0100

Add pledge(2) on OpenBSD

Diffstat:
Mmain.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/main.c b/main.c @@ -1,3 +1,4 @@ +#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <math.h> @@ -140,6 +141,12 @@ main(int argc, char* argv[]) unsigned long iter, stressiter; double new_phi, new_k, filetimeclock, res_norm, mu_wall_orig; +#ifdef __OpenBSD__ + if (pledge("stdio", NULL) == -1) + fprintf(stderr, "error: pledge failed"); + exit(1); +#endif + /* load with default values */ sim = init_sim();