Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 517942
Collapse All | Expand All

(-)rng-tools-4.original/rngd.c (-3 / +6 lines)
Lines 93-99 static struct argp_option options[] = { Link Here
93
	  "Number of bytes written to random-device at a time (default: 64)" },
93
	  "Number of bytes written to random-device at a time (default: 64)" },
94
94
95
	{ "fill-watermark", 'W', "n", 0,
95
	{ "fill-watermark", 'W', "n", 0,
96
	  "Do not stop feeding entropy to random-device until at least n bits of entropy are available in the pool (default: 2048), 0 <= n <= 4096" },
96
	  "Do not stop feeding entropy to random-device until at least n bits of entropy are available in the pool (default: 2048), 0 <= n <= kernel entropy pool size (in bits)" },
97
97
98
	{ "quiet", 'q', 0, 0, "Suppress error messages" },
98
	{ "quiet", 'q', 0, 0, "Suppress error messages" },
99
99
Lines 166-173 static error_t parse_opt (int key, char Link Here
166
			argp_usage(state);
166
			argp_usage(state);
167
		break;
167
		break;
168
	case 'W': {
168
	case 'W': {
169
		int n;
169
		int n, poolsize = 512;
170
		if ((sscanf(arg, "%i", &n) == 0) || (n < 0) || (n > 4096))
170
		FILE *pf;
171
		pf = fopen( "/proc/sys/kernel/random/poolsize", "r" );
172
		fscanf( pf, "%d", &poolsize );
173
		if ((sscanf(arg, "%i", &n) == 0) || (n < 0) || (n > 8*poolsize))
171
			argp_usage(state);
174
			argp_usage(state);
172
		else
175
		else
173
			arguments->fill_watermark = n;
176
			arguments->fill_watermark = n;

Return to bug 517942