mirror of
https://github.com/troglobit/finit.git
synced 2026-10-05 15:23:31 +07:00
Audit b0663d0, add newline to generation ID in cond files
- Add newline to cond generation ID, like PID files, easier when debugging. Does not affect fscanf() in cond_get_gen() - Update copyright years Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+6
-4
@@ -1,6 +1,6 @@
|
||||
/* Condition engine (write)
|
||||
*
|
||||
* Copyright (c) 2015-2016 Tobias Waldekranz <tobias@waldekranz.com>
|
||||
* Copyright (c) 2015-2017 Tobias Waldekranz <tobias@waldekranz.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -39,7 +39,7 @@ static int cond_set_gen(const char *path, unsigned int gen)
|
||||
if (!fp)
|
||||
return -1;
|
||||
|
||||
ret = fprintf(fp, "%u", gen);
|
||||
ret = fprintf(fp, "%u\n", gen);
|
||||
fclose(fp);
|
||||
|
||||
return (ret > 0) ? 0 : ret;
|
||||
@@ -49,9 +49,11 @@ static void cond_bump_reconf(void)
|
||||
{
|
||||
unsigned int rgen;
|
||||
|
||||
/*
|
||||
* If %COND_RECONF does not exist, cond_get_gen() returns 0
|
||||
* meaning that rgen++ is always what we want.
|
||||
*/
|
||||
rgen = cond_get_gen(COND_RECONF);
|
||||
/* COND_RECONF does not exist, cond_get_gen will return 0
|
||||
* meaning that rgen++ is always what we want. */
|
||||
rgen++;
|
||||
|
||||
cond_set_gen(COND_RECONF, rgen);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Condition engine (read)
|
||||
*
|
||||
* Copyright (c) 2015-2016 Tobias Waldekranz <tobias@waldekranz.com>
|
||||
* Copyright (c) 2015-2017 Tobias Waldekranz <tobias@waldekranz.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
Reference in New Issue
Block a user