mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00: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:
1 parent
c1023c03c7
commit
360f3e72bc
2 files changed
+7
-5
No files matched your search
+6
-4
@@ -1,6 +1,6 @@
|
|||||||
/* Condition engine (write)
|
/* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* 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)
|
if (!fp)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ret = fprintf(fp, "%u", gen);
|
ret = fprintf(fp, "%u\n", gen);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
return (ret > 0) ? 0 : ret;
|
return (ret > 0) ? 0 : ret;
|
||||||
@@ -49,9 +49,11 @@ static void cond_bump_reconf(void)
|
|||||||
{
|
{
|
||||||
unsigned int rgen;
|
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);
|
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++;
|
rgen++;
|
||||||
|
|
||||||
cond_set_gen(COND_RECONF, rgen);
|
cond_set_gen(COND_RECONF, rgen);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* Condition engine (read)
|
/* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
Reference in new issue
Block a user