Révision c01ddbb0
extract function getenvint to common.c
| tools/munin-plugins-busybox/common.c | ||
|---|---|---|
| 1 | 1 |
#include <stdio.h> |
| 2 |
#include <stdlib.h> |
|
| 2 | 3 |
|
| 3 | 4 |
int writeyes(void) {
|
| 4 | 5 |
puts("yes");
|
| ... | ... | |
| 12 | 13 |
puts("no");
|
| 13 | 14 |
return 1; |
| 14 | 15 |
} |
| 16 |
|
|
| 17 |
int getenvint(const char *name, int defvalue) {
|
|
| 18 |
const char *value; |
|
| 19 |
value = getenv(name); |
|
| 20 |
if(value == NULL) |
|
| 21 |
return defvalue; |
|
| 22 |
return atoi(value); |
|
| 23 |
} |
|
Formats disponibles : Unified diff