ref: 595501b005f591527680080e606c9ab0f1d99701
parent: 0aa5b01fab130618fa63e9a6684265904a9f98b5
author: cinap_lenrek <[email protected]>
date: Wed Mar 9 22:02:28 EST 2016
kernel: make fversion()/mntversion() types consistent
--- a/sys/src/9/port/auth.c
+++ b/sys/src/9/port/auth.c
@@ -22,18 +22,17 @@
uintptr
sysfversion(va_list list)
{
- uint msize, arglen;
+ int msize, arglen, fd;
char *vers;
Chan *c;
- int fd;
fd = va_arg(list, int);
- msize = va_arg(list, uint);
+ msize = va_arg(list, int);
vers = va_arg(list, char*);
- arglen = va_arg(list, uint);
+ arglen = va_arg(list, int);
validaddr((uintptr)vers, arglen, 1);
/* check there's a NUL in the version string */
- if(arglen==0 || memchr(vers, 0, arglen)==0)
+ if(arglen <= 0 || memchr(vers, 0, arglen) == nil)
error(Ebadarg);
c = fdtochan(fd, ORDWR, 0, 1);
if(waserror()){
--- a/sys/src/9/port/devmnt.c
+++ b/sys/src/9/port/devmnt.c
@@ -90,7 +90,7 @@
/*
* Version is not multiplexed: message sent only once per connection.
*/
-long
+int
mntversion(Chan *c, char *version, int msize, int returnlen)
{
Fcall f;
@@ -259,7 +259,7 @@
m = c->mux;
if(m == nil){
- mntversion(c, VERSION9P, MAXRPC, 0);
+ mntversion(c, nil, 0, 0);
m = c->mux;
if(m == nil)
error(Enoversion);
--- a/sys/src/9/port/portfns.h
+++ b/sys/src/9/port/portfns.h
@@ -176,7 +176,7 @@
void mmuswitch(Proc*);
Chan* mntattach(Chan*, Chan*, char*, int);
Chan* mntauth(Chan*, char*);
-long mntversion(Chan*, char*, int, int);
+int mntversion(Chan*, char*, int, int);
void mouseresize(void);
void mountfree(Mount*);
ulong ms2tk(ulong);