ig systemd could restart it if it exits with 0
This commit is contained in:
@@ -175,14 +175,14 @@ int main(void) {
|
||||
|
||||
/* see if another instance is up, quit if it is */
|
||||
if (get_instance_lock() < 0)
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
/* malloc memory for the struct */
|
||||
struct sensors_t *sensors = malloc(sizeof(*sensors)); // no actual point in mallocing and it is ever so sligtly slower to access heap vs stack, but its cool
|
||||
if (sensors == NULL) {
|
||||
applog(LOG_ERR, "can't allocate mem for the sensor struct. You don't got %lu bytes bro?", sizeof(struct sensors_t));
|
||||
free(sensors);
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
applog(LOG_INF, "sensor struct allocated, size is %lu bytes", sizeof(struct sensors_t));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user