aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-02-26 20:08:37 +0000
committerDavid Howells <dhowells@redhat.com>2010-02-26 20:08:37 +0000
commitf90aa81f363c80b901af89f240f52942d7bcec89 (patch)
treeb6a39352749ac325107200acca94f84069bbf5f0
parentebaf857743f5afcc998086ae4f333ca3f5b5c2a1 (diff)
downloadcachefilesd-f90aa81f363c80b901af89f240f52942d7bcec89.tar.gz
Bump the minor version to 0.10v0.10
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--cachefilesd.c24
-rw-r--r--redhat/cachefilesd.spec2
2 files changed, 22 insertions, 4 deletions
diff --git a/cachefilesd.c b/cachefilesd.c
index 3973e2a..4887c42 100644
--- a/cachefilesd.c
+++ b/cachefilesd.c
@@ -27,6 +27,8 @@
* NUL characters are cause for error
*/
+#define CACHEFILESD_VERSION "0.10"
+
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdio.h>
@@ -111,12 +113,20 @@ static unsigned long long brun, bcull, bstop, frun, fcull, fstop;
#define cachefd 3
-static void help(void) __attribute__((noreturn));
-static void help(void)
+static __attribute__((noreturn))
+void version(void)
+{
+ printf("cachefilesd version " CACHEFILESD_VERSION "\n");
+ exit(0);
+}
+
+static __attribute__((noreturn))
+void help(void)
{
fprintf(stderr,
"Format:\n"
" /sbin/cachefilesd [-d]* [-s] [-n] [-p <pidfile>] [-f <configfile>]\n"
+ " /sbin/cachefilesd -v\n"
"\n"
"Options:\n"
" -d\tIncrease debugging level (cumulative)\n"
@@ -124,6 +134,7 @@ static void help(void)
" -s\tMessage output to stderr instead of syslog\n"
" -p <pidfile>\tWrite the PID into the file\n"
" -f <configfile>\n"
+ " -v\tPrint version and exit\n"
"\tRead the specified configuration file instead of"
" /etc/cachefiles.conf\n");
@@ -271,8 +282,11 @@ int main(int argc, char *argv[])
if (argc == 2 && strcmp(argv[1], "--help") == 0)
help();
+ if (argc == 2 && strcmp(argv[1], "--version") == 0)
+ version();
+
/* parse the arguments */
- while (opt = getopt(argc, argv, "dsnf:p:"),
+ while (opt = getopt(argc, argv, "dsnf:p:v"),
opt != EOF
) {
switch (opt) {
@@ -301,6 +315,10 @@ int main(int argc, char *argv[])
pidfile = optarg;
break;
+ case 'v':
+ /* print the version and exit */
+ version();
+
default:
opterror("Unknown commandline option '%c'", optopt);
}
diff --git a/redhat/cachefilesd.spec b/redhat/cachefilesd.spec
index 1f023ca..11b79e9 100644
--- a/redhat/cachefilesd.spec
+++ b/redhat/cachefilesd.spec
@@ -2,7 +2,7 @@
%define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
Name: cachefilesd
-Version: 0.9
+Version: 0.10
Release: 1%{?dist}
Summary: CacheFiles userspace management daemon
Group: System Environment/Daemons