- Fix gcc 4.11 issue
This commit is contained in:
parent
f0691274e2
commit
d54f3684af
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=180103
1 changed files with 47 additions and 0 deletions
47
sysutils/upsd/files/patch-misc.c
Normal file
47
sysutils/upsd/files/patch-misc.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
--- misc.c.orig Sat Aug 3 01:44:24 1996
|
||||
+++ misc.c Mon Dec 18 21:03:19 2006
|
||||
@@ -27,7 +27,7 @@
|
||||
pathname);
|
||||
return -1;
|
||||
}
|
||||
- fprintf(f, "%ld\n", getpid());
|
||||
+ fprintf(f, "%u\n", getpid());
|
||||
fclose(f);
|
||||
umask(oldmask);
|
||||
return 0;
|
||||
@@ -60,7 +60,7 @@
|
||||
{
|
||||
register char *p;
|
||||
if((p = malloc(size)) == NULL) {
|
||||
- syslog(LOG_ERR, "xalloc: cannot allocate %ls bytes: %m", size);
|
||||
+ syslog(LOG_ERR, "xalloc: cannot allocate %u bytes: %m", size);
|
||||
return NULL;
|
||||
}
|
||||
return p;
|
||||
@@ -105,7 +105,7 @@
|
||||
if(((struct ident *)list)->id == 0) {
|
||||
return NULL;
|
||||
}
|
||||
- (char *)list += size;
|
||||
+ list += size;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -122,7 +122,7 @@
|
||||
register void *list;
|
||||
register size_t size;
|
||||
{
|
||||
- for(;((struct ident *)list)->id != 0;(char *)list += size) {
|
||||
+ for(;((struct ident *)list)->id != 0;list += size) {
|
||||
if(((struct ident *)list)->name == name) {
|
||||
return list;
|
||||
}
|
||||
@@ -255,7 +255,7 @@
|
||||
int
|
||||
getcurrenttime(void)
|
||||
{
|
||||
- if(time(¤t_time) == NULL) {
|
||||
+ if(time(¤t_time) == -1) {
|
||||
syslog(LOG_ERR, "cannot get current time: %m");
|
||||
return -1;
|
||||
}
|
Loading…
Reference in a new issue