Skip to content
Snippets Groups Projects
Commit 13e2fd75 authored by Yang Sheng's avatar Yang Sheng
Browse files

Branch HEAD

b=16771
i=adilger, shadow (Author: johann)

Calm donw the compiler warning.
parent f068abec
No related branches found
No related tags found
No related merge requests found
...@@ -366,6 +366,7 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip) ...@@ -366,6 +366,7 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
case(LCFG_MARKER):{ case(LCFG_MARKER):{
struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1); struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
char createtime[26], canceltime[26] = ""; char createtime[26], canceltime[26] = "";
time_t time_tmp;
if (marker->cm_flags & CM_SKIP) { if (marker->cm_flags & CM_SKIP) {
if (marker->cm_flags & CM_START) { if (marker->cm_flags & CM_START) {
...@@ -376,19 +377,39 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip) ...@@ -376,19 +377,39 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
*skip = 0; *skip = 0;
} }
} }
if (marker->cm_flags & CM_EXCLUDE) { if (marker->cm_flags & CM_EXCLUDE) {
if (marker->cm_flags & CM_START) if (marker->cm_flags & CM_START)
printf("EXCLUDE START "); printf("EXCLUDE START ");
else else
printf("EXCLUDE END "); printf("EXCLUDE END ");
} }
ctime_r((time_t *)((char*)&marker->cm_createtime), createtime);
createtime[strlen(createtime) - 1] = 0; /* Handle overflow of 32-bit time_t gracefully.
* The copy to time_tmp is needed in any case to
* keep the pointer happy, even on 64-bit systems. */
time_tmp = marker->cm_createtime;
if (time_tmp == marker->cm_createtime) {
ctime_r(&time_tmp, createtime);
createtime[strlen(createtime) - 1] = 0;
} else {
strcpy(createtime, "in the distant future");
}
if (marker->cm_canceltime) { if (marker->cm_canceltime) {
ctime_r((time_t *)((char*)&marker->cm_canceltime), /* Like cm_createtime, we try to handle overflow of
canceltime); * 32-bit time_t gracefully. The copy to time_tmp
canceltime[strlen(canceltime) - 1] = 0; * is also needed on 64-bit systems to keep the
* pointer happy, see bug 16771 */
time_tmp = marker->cm_canceltime;
if (time_tmp == marker->cm_canceltime) {
ctime_r(&time_tmp, canceltime);
canceltime[strlen(canceltime) - 1] = 0;
} else {
strcpy(canceltime, "in the distant future");
}
} }
printf("marker %3d (flags=%#04x, v%d.%d.%d.%d) %-15s '%s' %s-%s", printf("marker %3d (flags=%#04x, v%d.%d.%d.%d) %-15s '%s' %s-%s",
marker->cm_step, marker->cm_flags, marker->cm_step, marker->cm_flags,
OBD_OCD_VERSION_MAJOR(marker->cm_vers), OBD_OCD_VERSION_MAJOR(marker->cm_vers),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment