X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ffunctional%2Fsscanf_long.c;h=c9208af0b2901fcdc28efac49b1cb36b014fc8c3;hb=2c671f66e28ac079ae1148f5135c9a52129cc807;hp=a26999df3f14c76abf0f89d0de61de9d939db62d;hpb=2cf89517c5b25c2524fe0c0c01ed277d7307a852;p=libc-test diff --git a/src/functional/sscanf_long.c b/src/functional/sscanf_long.c index a26999d..c9208af 100644 --- a/src/functional/sscanf_long.c +++ b/src/functional/sscanf_long.c @@ -6,17 +6,6 @@ #include #include "test.h" -static void setrl(int r, long lim) -{ - struct rlimit rl; - - if (getrlimit(r, &rl)) - error("getrlimit %d: %s\n", r, strerror(errno)); - rl.rlim_cur = lim; - if (setrlimit(r, &rl)) - error("setrlimit %d: %s\n", r, strerror(errno)); -} - int main(void) { enum {n = 8*1024*1024}; @@ -26,8 +15,8 @@ int main(void) char c; if (!s) - return error("out of memory"); - setrl(RLIMIT_STACK, 128*1024); + return t_error("out of memory"); + t_setrlim(RLIMIT_STACK, 100*1024); for (i = 0; i < n; i++) s[i] = '1'; s[n-3] = ' '; @@ -41,11 +30,11 @@ int main(void) i = sscanf(s, "%f %c", &f, &c); if (i != 2) - error("sscanf returned %d, want 2\n", i); + t_error("sscanf returned %d, want 2\n", i); if (f != INFINITY) - error("sscanf(longnum, \"%%f\") read %f, want inf\n", f); + t_error("sscanf(longnum, \"%%f\") read %f, want inf\n", f); if (c != '1') - error("sscanf(\"1\", %%c) read '%c', want '1'\n", c); + t_error("sscanf(\"1\", %%c) read '%c', want '1'\n", c); free(s); - return test_status; + return t_status; }