various warning/errorwarning fixes for gcc47

. warnings (sometimes promoted to errors) in servers/ and kernel/
 . -Os for ext2 boot module to make it small enough
This commit is contained in:
Ben Gras
2012-08-25 19:42:05 +02:00
parent 2af02e0d5d
commit e4ac80eb60
20 changed files with 23 additions and 72 deletions

View File

@@ -5,6 +5,7 @@
#include "fs.h"
#include <sys/stat.h>
#include <string.h>
#include <assert.h>
#include <minix/com.h>
#include "buf.h"
#include "inode.h"
@@ -191,7 +192,7 @@ int fs_slink()
struct inode *ldirp; /* directory containing link */
register int r; /* error code */
char string[NAME_MAX]; /* last component of the new dir's path name */
char* link_target_buf; /* either sip->i_block or bp->b_data */
char* link_target_buf = NULL; /* either sip->i_block or bp->b_data */
struct buf *bp = NULL; /* disk buffer for link */
caller_uid = (uid_t) fs_m_in.REQ_UID;
@@ -241,6 +242,7 @@ int fs_slink()
}
}
if (r == OK) {
assert(link_target_buf);
link_target_buf[fs_m_in.REQ_MEM_SIZE] = '\0';
sip->i_size = (off_t) strlen(link_target_buf);
if (sip->i_size != fs_m_in.REQ_MEM_SIZE) {