version 1.29, 2014/08/21 01:08:52 |
version 1.30, 2015/01/20 23:14:00 |
|
|
* Second step: test primes' safety (processor intensive) |
* Second step: test primes' safety (processor intensive) |
*/ |
*/ |
|
|
#include <sys/param.h> |
#include <sys/param.h> /* MAX */ |
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <openssl/bn.h> |
#include <openssl/bn.h> |
|
|
#include <stdarg.h> |
#include <stdarg.h> |
#include <time.h> |
#include <time.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <limits.h> |
|
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "dh.h" |
#include "dh.h" |
|
|
write_checkpoint(char *cpfile, u_int32_t lineno) |
write_checkpoint(char *cpfile, u_int32_t lineno) |
{ |
{ |
FILE *fp; |
FILE *fp; |
char tmp[MAXPATHLEN]; |
char tmp[PATH_MAX]; |
int r; |
int r; |
|
|
r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); |
r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); |
if (r == -1 || r >= MAXPATHLEN) { |
if (r == -1 || r >= PATH_MAX) { |
logit("write_checkpoint: temp pathname too long"); |
logit("write_checkpoint: temp pathname too long"); |
return; |
return; |
} |
} |