Merge branch 'aspiers-fix-compile-warnings'

pull/398/head
Timothy Stack 8 years ago
commit 854c79108e

@ -2449,7 +2449,9 @@ int main(int argc, char *argv[])
case 'W': case 'W':
{ {
char b; char b;
read(STDIN_FILENO, &b, 1); if (read(STDIN_FILENO, &b, 1) == -1) {
perror("Read key from STDIN");
}
} }
break; break;
@ -2496,7 +2498,17 @@ int main(int argc, char *argv[])
snprintf(pull_cmd, sizeof(pull_cmd), snprintf(pull_cmd, sizeof(pull_cmd),
"cd %s && git pull", "cd %s && git pull",
git_dir); git_dir);
system(pull_cmd); int ret = system(pull_cmd);
if (ret == -1) {
std::cerr << "Failed to spawn command "
<< "\"" << pull_cmd << "\": "
<< strerror(errno) << std::endl;
}
else if (ret > 0) {
std::cerr << "Command "
<< "\"" << pull_cmd << "\" failed: "
<< strerror(errno) << std::endl;
}
found = true; found = true;
} }
} }
@ -3000,8 +3012,11 @@ int main(int argc, char *argv[])
++vl, ++y) { ++vl, ++y) {
while (los != NULL && while (los != NULL &&
los->list_value_for_overlay(*tc, y, al)) { los->list_value_for_overlay(*tc, y, al)) {
write(STDOUT_FILENO, line.c_str(), line.length()); if (write(STDOUT_FILENO, line.c_str(),
write(STDOUT_FILENO, "\n", 1); line.length()) == -1 ||
write(STDOUT_FILENO, "\n", 1) == -1) {
perror("write to STDOUT");
}
++y; ++y;
} }
@ -3012,9 +3027,11 @@ int main(int argc, char *argv[])
struct line_range lr = find_string_attr_range( struct line_range lr = find_string_attr_range(
al.get_attrs(), &textview_curses::SA_ORIGINAL_LINE); al.get_attrs(), &textview_curses::SA_ORIGINAL_LINE);
write(STDOUT_FILENO, lr.substr(al.get_string()), if (write(STDOUT_FILENO, lr.substr(al.get_string()),
lr.sublen(al.get_string())); lr.sublen(al.get_string())) == -1 ||
write(STDOUT_FILENO, "\n", 1); write(STDOUT_FILENO, "\n", 1) == -1) {
perror("write to STDOUT");
}
} }
} }
} }
@ -3070,8 +3087,10 @@ int main(int argc, char *argv[])
++line_iter) { ++line_iter) {
lf->read_line(line_iter, str); lf->read_line(line_iter, str);
write(STDOUT_FILENO, str.c_str(), str.size()); if (write(STDOUT_FILENO, str.c_str(), str.size()) == -1 ||
write(STDOUT_FILENO, "\n", 1); write(STDOUT_FILENO, "\n", 1) == -1) {
perror("write to STDOUT");
}
} }
} }
} }

@ -64,7 +64,7 @@ static string remaining_args(const string &cmdline,
require(index > 0); require(index > 0);
for (int lpc = 0; lpc < index; lpc++) { for (size_t lpc = 0; lpc < index; lpc++) {
start_pos += args[lpc].length(); start_pos += args[lpc].length();
} }
@ -571,7 +571,7 @@ static string com_save_to(exec_context &ec, string cmdline, vector<string> &args
dos.list_value_for_overlay(lnav_data.ld_views[LNV_DB], vis_line_t(0), header_line); dos.list_value_for_overlay(lnav_data.ld_views[LNV_DB], vis_line_t(0), header_line);
fputs(header_line.get_string().c_str(), outfile); fputs(header_line.get_string().c_str(), outfile);
fputc('\n', outfile); fputc('\n', outfile);
for (int lpc = 0; lpc < dls.text_line_count(); lpc++) { for (size_t lpc = 0; lpc < dls.text_line_count(); lpc++) {
string line; string line;
dls.text_value_for_line(lnav_data.ld_views[LNV_DB], lpc, line, true); dls.text_value_for_line(lnav_data.ld_views[LNV_DB], lpc, line, true);

@ -182,8 +182,12 @@ void log_host_info(void)
log_info(" gid=%d", getgid()); log_info(" gid=%d", getgid());
log_info(" euid=%d", geteuid()); log_info(" euid=%d", geteuid());
log_info(" egid=%d", getegid()); log_info(" egid=%d", getegid());
getcwd(cwd, sizeof(cwd)); if (getcwd(cwd, sizeof(cwd)) == NULL) {
log_info(" cwd=%s", cwd); log_info(" ERROR: getcwd failed");
}
else {
log_info(" cwd=%s", cwd);
}
log_info("Executable:"); log_info("Executable:");
log_info(" version=%s", VCS_PACKAGE_STRING); log_info(" version=%s", VCS_PACKAGE_STRING);

@ -319,7 +319,7 @@ static time_t BAD_DATE = -1;
time_t tm2sec(const struct tm *t) time_t tm2sec(const struct tm *t)
{ {
int year; int year;
time_t days; time_t days, secs;
const int dayoffset[12] = const int dayoffset[12] =
{ 306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275 }; { 306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275 };
@ -341,18 +341,18 @@ time_t tm2sec(const struct tm *t)
days += dayoffset[t->tm_mon] + t->tm_mday - 1; days += dayoffset[t->tm_mon] + t->tm_mday - 1;
days -= 25508; /* 1 jan 1970 is 25508 days since 1 mar 1900 */ days -= 25508; /* 1 jan 1970 is 25508 days since 1 mar 1900 */
days = ((days * 24 + t->tm_hour) * 60 + t->tm_min) * 60 + t->tm_sec; secs = ((days * 24 + t->tm_hour) * 60 + t->tm_min) * 60 + t->tm_sec;
if (days < 0) { if (secs < 0) {
return BAD_DATE; return BAD_DATE;
} /* must have overflowed */ } /* must have overflowed */
else { else {
#ifdef HAVE_STRUCT_TM_TM_ZONE #ifdef HAVE_STRUCT_TM_TM_ZONE
if (t->tm_zone) { if (t->tm_zone) {
days -= t->tm_gmtoff; secs -= t->tm_gmtoff;
} }
#endif #endif
return days; return secs;
} /* must be a valid time */ } /* must be a valid time */
} }

@ -102,9 +102,9 @@ public:
this->ptp_search.c_str(), this->ptp_search.c_str(),
this->ptp_search.size()); this->ptp_search.size());
asprintf(this->ptp_token_header.out(), log_perror(asprintf(this->ptp_token_header.out(),
"X-Papertrail-Token: %s", "X-Papertrail-Token: %s",
this->ptp_api_key); this->ptp_api_key));
this->ptp_header_list = curl_slist_append(this->ptp_header_list, this->ptp_header_list = curl_slist_append(this->ptp_header_list,
this->ptp_token_header.in()); this->ptp_token_header.in());
@ -140,10 +140,10 @@ public:
"max_time=%ld&", "max_time=%ld&",
this->ptp_max_time); this->ptp_max_time);
} }
asprintf(this->ptp_url.out(), log_perror(asprintf(this->ptp_url.out(),
"%sq=%s", "%sq=%s",
base_url, base_url,
this->ptp_quoted_search.in()); this->ptp_quoted_search.in()));
curl_easy_setopt(this->cr_handle, CURLOPT_URL, this->ptp_url.in()); curl_easy_setopt(this->cr_handle, CURLOPT_URL, this->ptp_url.in());
}; };

@ -38,6 +38,7 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#include <inttypes.h>
#include <sys/types.h> #include <sys/types.h>
#include <arpa/inet.h> #include <arpa/inet.h>
@ -381,10 +382,10 @@ inline bool ptime_i(struct exttm *dst, const char *str, off_t &off_inout, ssize_
inline void ftime_i(char *dst, off_t &off_inout, ssize_t len, const struct exttm &tm) inline void ftime_i(char *dst, off_t &off_inout, ssize_t len, const struct exttm &tm)
{ {
uint64_t t = tm2sec(&tm.et_tm); int64_t t = tm2sec(&tm.et_tm);
t += tm.et_nsec / 1000000; t += tm.et_nsec / 1000000;
snprintf(&dst[off_inout], len - off_inout, "%lld", t); snprintf(&dst[off_inout], len - off_inout, "%" PRId64, t);
off_inout = strlen(dst); off_inout = strlen(dst);
} }

@ -219,7 +219,7 @@ bool relative_time::parse(const char *str, size_t len, struct parse_error &pe_ou
string numstr = pi.get_substr(pc[0]); string numstr = pi.get_substr(pc[0]);
if (sscanf(numstr.c_str(), "%qd", &number) != 1) { if (sscanf(numstr.c_str(), "%" PRId64, &number) != 1) {
pe_out.pe_msg = "Invalid number: " + numstr; pe_out.pe_msg = "Invalid number: " + numstr;
return false; return false;
} }

@ -76,7 +76,8 @@ public:
default: default:
log_error("%s:curl failure -- %ld %s", log_error("%s:curl failure -- %ld %s",
this->cr_name.c_str(), result, curl_easy_strerror(result)); this->cr_name.c_str(), result, curl_easy_strerror(result));
write(this->ul_fd, this->cr_error_buffer, strlen(this->cr_error_buffer)); log_perror(write(this->ul_fd, this->cr_error_buffer,
strlen(this->cr_error_buffer)));
return -1; return -1;
} }

@ -100,7 +100,6 @@ Caused by: java.lang.ClassNotFoundException: javax.el.StaticFieldELResolver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 33 common frames omitted ... 33 common frames omitted
@version: 1 @version: 1
logger_name: org.apache.jasper.runtime.JspFactoryImpl logger_name: org.apache.jasper.runtime.JspFactoryImpl
thread_name: http-bio-0.0.0.0-8081-exec-198 thread_name: http-bio-0.0.0.0-8081-exec-198

Loading…
Cancel
Save