Skip to content
Snippets Groups Projects
Commit 33e75ca7 authored by ballen4705's avatar ballen4705
Browse files

Fixed problem with static initializer in opts[]

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@22 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 5fabe1f2
No related branches found
No related tags found
No related merge requests found
\# Copyright (C) 2002 Bruce Allen <ballen@uwm.edu>
\#
\# $Id: smartctl.8,v 1.4 2002/10/10 13:21:15 ballen4705 Exp $
\# $Id: smartctl.8,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $
\#
\# This program is free software; you can redistribute it and/or modify it
\# under the terms of the GNU General Public License as published by the Free
......@@ -10,7 +10,7 @@
\# You should have received a copy of the GNU General Public License (for
\# example COPYING); if not, write to the Free Software Foundation, Inc., 675
\# Mass Ave, Cambridge, MA 02139, USA.
.TH SMARTCTL 8 "$Date: 2002/10/10 13:21:15 $" "smartmontools-5.0"
.TH SMARTCTL 8 "$Date: 2002/10/11 03:46:17 $" "smartmontools-5.0"
.SH NAME
smartctl \- S.M.A.R.T. control utility
.SH SYNOPSIS
......@@ -57,7 +57,7 @@ p.
.B Read-only options:
.TP
p
Print: Prints Copyright and License information.
Print: Prints version, copyright and license information.
.TP
i
Information: Check if the device supports S.M.A.R.T. Prints the
......@@ -296,4 +296,4 @@ Please let us know if there is an on\-line source for this document.
.SH
CVS ID OF THIS PAGE:
$Id: smartctl.8,v 1.4 2002/10/10 13:21:15 ballen4705 Exp $
$Id: smartctl.8,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $
// $Id: smartctl.c,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $
// $Id: smartctl.c,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $
/*
* smartctl.c
*
......@@ -113,14 +113,6 @@ void Usage ( void){
}
/* void ParseOpts ( chars *opts)
Takes command options and sets features to be run */
void ParseOpts (int argc, char** argv){
int optchar;
extern char *optarg;
extern int optopt, optind;
const char opts[] = {
DRIVEINFO, CHECKSMART, SMARTVERBOSEALL, SMARTVENDORATTRIB,
GENERALSMARTVALUES, SMARTERRORLOG, SMARTSELFTESTLOG, SMARTDISABLE,
......@@ -130,8 +122,14 @@ void ParseOpts (int argc, char** argv){
SMARTAUTOSAVEENABLE,SMARTAUTOSAVEDISABLE,PRINTCOPYLEFT,'\0'
};
/* Takes command options and sets features to be run */
void ParseOpts (int argc, char** argv){
int optchar;
extern char *optarg;
extern int optopt, optind, opterr;
while(EOF != (optchar = getopt(argc, argv, opts))) {
opterr=1;
while (-1 != (optchar = getopt(argc, argv, opts))) {
switch (optchar){
case PRINTCOPYLEFT :
printcopyleft=TRUE;
......@@ -231,7 +229,7 @@ int main (int argc, char **argv){
printf("is free software, and you are welcome to redistribute it\n");
printf("under the terms of the GNU General Public License Version 2.\n");
printf("See http://www.gnu.org for further details.\n\n");
printf("CVS version ID %s\n","$Id: smartctl.c,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $");
printf("CVS version ID %s\n","$Id: smartctl.c,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $");
exit(0);
}
......
// $Id: smartctl.cpp,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $
// $Id: smartctl.cpp,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $
/*
* smartctl.c
*
......@@ -113,14 +113,6 @@ void Usage ( void){
}
/* void ParseOpts ( chars *opts)
Takes command options and sets features to be run */
void ParseOpts (int argc, char** argv){
int optchar;
extern char *optarg;
extern int optopt, optind;
const char opts[] = {
DRIVEINFO, CHECKSMART, SMARTVERBOSEALL, SMARTVENDORATTRIB,
GENERALSMARTVALUES, SMARTERRORLOG, SMARTSELFTESTLOG, SMARTDISABLE,
......@@ -130,8 +122,14 @@ void ParseOpts (int argc, char** argv){
SMARTAUTOSAVEENABLE,SMARTAUTOSAVEDISABLE,PRINTCOPYLEFT,'\0'
};
/* Takes command options and sets features to be run */
void ParseOpts (int argc, char** argv){
int optchar;
extern char *optarg;
extern int optopt, optind, opterr;
while(EOF != (optchar = getopt(argc, argv, opts))) {
opterr=1;
while (-1 != (optchar = getopt(argc, argv, opts))) {
switch (optchar){
case PRINTCOPYLEFT :
printcopyleft=TRUE;
......@@ -231,7 +229,7 @@ int main (int argc, char **argv){
printf("is free software, and you are welcome to redistribute it\n");
printf("under the terms of the GNU General Public License Version 2.\n");
printf("See http://www.gnu.org for further details.\n\n");
printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.3 2002/10/11 00:38:22 ballen4705 Exp $");
printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.4 2002/10/11 03:46:17 ballen4705 Exp $");
exit(0);
}
......
......@@ -8,7 +8,7 @@
\# You should have received a copy of the GNU General Public License (for
\# example COPYING); if not, write to the Free Software Foundation, Inc., 675
\# Mass Ave, Cambridge, MA 02139, USA.
.TH SMARTD 8 "$Date: 2002/10/10 13:21:17 $" "smartmontools-5.0"
.TH SMARTD 8 "$Date: 2002/10/11 03:46:17 $" "smartmontools-5.0"
.SH NAME
smartd \- S.M.A.R.T. Daemon
.SH SYNOPSIS
......@@ -26,7 +26,7 @@ smartd is compatible with ATA/ATAPI-5 and earlier standards (see
REFERENCES below)
.B smartd
is daemon designed to notify users of S.M.A.R.T. errors and changes of
will notify users of S.M.A.R.T. errors and changes of
S.M.A.R.T. attributes via the SYSLOG interface. These notifications
and warnings normally appear in /var/log/messages.
......@@ -45,12 +45,18 @@ smartd
daemon scans for all devices that support S.M.A.R.T., using
"/dev/hd*" for IDE/ATA devices, and "/dev/sd*" for SCSI devices. It
polls these devices every 30 minutes checking for S.M.A.R.T. errors.
.PP
[Note that on start-up, when
.B
smartd
scans for devices, a warning message may appear in
/var/log/messages, about missing block-major-xx devices. These
messages are harmless.]
.P
.SH
OPTIONS
.TP
p
Prints license and copyright information onto STDOUT and into the SYSLOG
Prints license, copyright, and version information onto STDOUT or into the SYSLOG
log (normally /var/log/messages) and then exits.
.TP
X
......@@ -63,21 +69,35 @@ displays status information to STDOUT.
.B
smartd
.fi
runs in forked (daemon) mode. This is the normal way to run
runs the daemon in forked mode. This is the normal way to run
.B
smartd
smartd.
.fi
.fi
Note that smartmontools provides a start-up script in
.B /etc/rc.d/init.d/smartd
which is responsible for starting and stopping the daemon via the
normal init interface.
Using this script, you can start
.B
/etc/rc.d/init.d/smartd
which is responsible for starting and stopping the daemon via the normal init interface. This can be enabled using the command:
smartd
by giving the command
.B '/etc/rc.d/init.d/smartd start'
and stop it by using
.B '/etc/rc.d/init.d/smartd stop'.
If you want
.B
smartd
to start running whenever your machine is booted, this can be enabled by using the command:
.nf
/sbin/chkconfig --add smartd
.B '/sbin/chkconfig --add smartd'
.fi
and disabled using the command:
.nf
/sbin/chkconfig --del smartd
.B '/sbin/chkconfig --del smartd'
.PP
.SH AUTHOR
......@@ -149,4 +169,4 @@ Please let us know if there is an on\-line source for this document.
.SH
CVS ID OF THIS PAGE:
$Id: smartd.8,v 1.4 2002/10/10 13:21:17 ballen4705 Exp $
$Id: smartd.8,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $
// $Id: smartd.c,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $
// $Id: smartd.c,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $
/*
* smartd.c
*
......@@ -264,8 +264,9 @@ char copyleftstring[]=
"is free software, and you are welcome to redistribute it\n"
"under the terms of the GNU General Public License Version 2.\n"
"See http://www.gnu.org for further details.\n\n"
"CVS Version ID $Id: smartd.c,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $\n";
"CVS Version ID $Id: smartd.c,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $\n";
const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' };
/* Main Program */
int main (int argc, char **argv){
......@@ -274,15 +275,15 @@ int main (int argc, char **argv){
scsidevices_t scsidevices[MAXSCSIDEVICES], *scsidevicesptr;
int optchar;
extern char *optarg;
extern int optopt, optind;
const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' };
extern int optopt, optind, opterr;
numatadevices=0;
numscsidevices=0;
scsidevicesptr = scsidevices;
atadevicesptr = atadevices;
opterr=1;
while(EOF != (optchar = getopt(argc, argv, opts))){
while (-1 != (optchar = getopt(argc, argv, opts))){
switch(optchar) {
case PRINTCOPYLEFT:
printcopyleft=TRUE;
......
// $Id: smartd.cpp,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $
// $Id: smartd.cpp,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $
/*
* smartd.c
*
......@@ -264,8 +264,9 @@ char copyleftstring[]=
"is free software, and you are welcome to redistribute it\n"
"under the terms of the GNU General Public License Version 2.\n"
"See http://www.gnu.org for further details.\n\n"
"CVS Version ID $Id: smartd.cpp,v 1.4 2002/10/11 00:38:22 ballen4705 Exp $\n";
"CVS Version ID $Id: smartd.cpp,v 1.5 2002/10/11 03:46:17 ballen4705 Exp $\n";
const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' };
/* Main Program */
int main (int argc, char **argv){
......@@ -274,15 +275,15 @@ int main (int argc, char **argv){
scsidevices_t scsidevices[MAXSCSIDEVICES], *scsidevicesptr;
int optchar;
extern char *optarg;
extern int optopt, optind;
const char opts[] = { DEBUGMODE, EMAILNOTIFICATION, PRINTCOPYLEFT,'\0' };
extern int optopt, optind, opterr;
numatadevices=0;
numscsidevices=0;
scsidevicesptr = scsidevices;
atadevicesptr = atadevices;
opterr=1;
while(EOF != (optchar = getopt(argc, argv, opts))){
while (-1 != (optchar = getopt(argc, argv, opts))){
switch(optchar) {
case PRINTCOPYLEFT:
printcopyleft=TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment