aboutsummaryrefslogtreecommitdiff
path: root/sbin/adjkerntz/adjkerntz.c
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1997-06-10 11:01:13 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1997-06-10 11:01:13 +0000
commit4cabb4cdcc2f639312d99f8fee7b2181e1518d5f (patch)
treeec702ef4236f738e5635c03ffb87aaf89f71cdb4 /sbin/adjkerntz/adjkerntz.c
parente1775301d282c08526b7304b5616afa6f3bcc46c (diff)
downloadsrc-4cabb4cdcc2f639312d99f8fee7b2181e1518d5f.tar.gz
src-4cabb4cdcc2f639312d99f8fee7b2181e1518d5f.zip
Add Id, add usage function.
Notes
Notes: svn path=/head/; revision=26540
Diffstat (limited to 'sbin/adjkerntz/adjkerntz.c')
-rw-r--r--sbin/adjkerntz/adjkerntz.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c
index e8b069018cc2..f92ea5696f1f 100644
--- a/sbin/adjkerntz/adjkerntz.c
+++ b/sbin/adjkerntz/adjkerntz.c
@@ -22,6 +22,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $Id$
*/
#ifndef lint
@@ -61,6 +63,8 @@ char copyright[] =
#define REPORT_PERIOD (30*60)
+static void usage __P((void));
+
void fake() {}
int main(argc, argv)
@@ -86,26 +90,22 @@ int main(argc, argv)
switch((char)ch) {
case 'i': /* initial call, save offset */
if (init != Unknown)
- goto usage;
+ usage();
init = True;
break;
case 'a': /* adjustment call, use saved offset */
if (init != Unknown)
- goto usage;
+ usage();
init = False;
break;
case 's':
sleep_mode = True;
break;
default:
- usage:
- fprintf(stderr, "Usage:\n\
-\tadjkerntz -i\t\t(initial call from /etc/rc)\n\
-\tadjkerntz -a [-s]\t(adjustment call, -s for sleep/retry mode)\n");
- return 2;
+ usage();
}
if (init == Unknown)
- goto usage;
+ usage();
if (init)
sleep_mode = True;
@@ -348,3 +348,14 @@ recalculate:
return 0;
}
+
+static void
+usage()
+{
+ fprintf(stderr, "%s\n%s\n%s\n%s\n",
+ "usage: adjkerntz -i",
+ "\t\t(initial call from /etc/rc)",
+ " adjkerntz -a [-s]",
+ "\t\t(adjustment call, -s for sleep/retry mode)");
+ exit(2);
+}