From 360f3e72bc8ccae6b111ae3b473e6cab1712dae6 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 23 Dec 2017 10:05:45 +0100 Subject: [PATCH] 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 --- src/cond-w.c | 10 ++++++---- src/cond.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cond-w.c b/src/cond-w.c index e14e524c..3e87f6c1 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -1,6 +1,6 @@ /* Condition engine (write) * - * Copyright (c) 2015-2016 Tobias Waldekranz + * Copyright (c) 2015-2017 Tobias Waldekranz * * 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); diff --git a/src/cond.c b/src/cond.c index d01fae2f..67e73e78 100644 --- a/src/cond.c +++ b/src/cond.c @@ -1,6 +1,6 @@ /* Condition engine (read) * - * Copyright (c) 2015-2016 Tobias Waldekranz + * Copyright (c) 2015-2017 Tobias Waldekranz * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal