diff options
Diffstat (limited to 'arch/parisc/hpux')
-rw-r--r-- | arch/parisc/hpux/sys_hpux.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index cb69727027ae..2e2dc4f2c853 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -266,16 +266,21 @@ static int hpux_uname(struct hpux_utsname *name) | |||
266 | 266 | ||
267 | down_read(&uts_sem); | 267 | down_read(&uts_sem); |
268 | 268 | ||
269 | error = __copy_to_user(&name->sysname,&system_utsname.sysname,HPUX_UTSLEN-1); | 269 | error = __copy_to_user(&name->sysname, &utsname()->sysname, |
270 | error |= __put_user(0,name->sysname+HPUX_UTSLEN-1); | 270 | HPUX_UTSLEN - 1); |
271 | error |= __copy_to_user(&name->nodename,&system_utsname.nodename,HPUX_UTSLEN-1); | 271 | error |= __put_user(0, name->sysname + HPUX_UTSLEN - 1); |
272 | error |= __put_user(0,name->nodename+HPUX_UTSLEN-1); | 272 | error |= __copy_to_user(&name->nodename, &utsname()->nodename, |
273 | error |= __copy_to_user(&name->release,&system_utsname.release,HPUX_UTSLEN-1); | 273 | HPUX_UTSLEN - 1); |
274 | error |= __put_user(0,name->release+HPUX_UTSLEN-1); | 274 | error |= __put_user(0, name->nodename + HPUX_UTSLEN - 1); |
275 | error |= __copy_to_user(&name->version,&system_utsname.version,HPUX_UTSLEN-1); | 275 | error |= __copy_to_user(&name->release, &utsname()->release, |
276 | error |= __put_user(0,name->version+HPUX_UTSLEN-1); | 276 | HPUX_UTSLEN - 1); |
277 | error |= __copy_to_user(&name->machine,&system_utsname.machine,HPUX_UTSLEN-1); | 277 | error |= __put_user(0, name->release + HPUX_UTSLEN - 1); |
278 | error |= __put_user(0,name->machine+HPUX_UTSLEN-1); | 278 | error |= __copy_to_user(&name->version, &utsname()->version, |
279 | HPUX_UTSLEN - 1); | ||
280 | error |= __put_user(0, name->version + HPUX_UTSLEN - 1); | ||
281 | error |= __copy_to_user(&name->machine, &utsname()->machine, | ||
282 | HPUX_UTSLEN - 1); | ||
283 | error |= __put_user(0, name->machine + HPUX_UTSLEN - 1); | ||
279 | 284 | ||
280 | up_read(&uts_sem); | 285 | up_read(&uts_sem); |
281 | 286 | ||
@@ -373,8 +378,8 @@ int hpux_utssys(char *ubuf, int n, int type) | |||
373 | /* TODO: print a warning about using this? */ | 378 | /* TODO: print a warning about using this? */ |
374 | down_write(&uts_sem); | 379 | down_write(&uts_sem); |
375 | error = -EFAULT; | 380 | error = -EFAULT; |
376 | if (!copy_from_user(system_utsname.sysname, ubuf, len)) { | 381 | if (!copy_from_user(utsname()->sysname, ubuf, len)) { |
377 | system_utsname.sysname[len] = 0; | 382 | utsname()->sysname[len] = 0; |
378 | error = 0; | 383 | error = 0; |
379 | } | 384 | } |
380 | up_write(&uts_sem); | 385 | up_write(&uts_sem); |
@@ -400,8 +405,8 @@ int hpux_utssys(char *ubuf, int n, int type) | |||
400 | /* TODO: print a warning about this? */ | 405 | /* TODO: print a warning about this? */ |
401 | down_write(&uts_sem); | 406 | down_write(&uts_sem); |
402 | error = -EFAULT; | 407 | error = -EFAULT; |
403 | if (!copy_from_user(system_utsname.release, ubuf, len)) { | 408 | if (!copy_from_user(utsname()->release, ubuf, len)) { |
404 | system_utsname.release[len] = 0; | 409 | utsname()->release[len] = 0; |
405 | error = 0; | 410 | error = 0; |
406 | } | 411 | } |
407 | up_write(&uts_sem); | 412 | up_write(&uts_sem); |
@@ -422,13 +427,13 @@ int hpux_getdomainname(char *name, int len) | |||
422 | 427 | ||
423 | down_read(&uts_sem); | 428 | down_read(&uts_sem); |
424 | 429 | ||
425 | nlen = strlen(system_utsname.domainname) + 1; | 430 | nlen = strlen(utsname()->domainname) + 1; |
426 | 431 | ||
427 | if (nlen < len) | 432 | if (nlen < len) |
428 | len = nlen; | 433 | len = nlen; |
429 | if(len > __NEW_UTS_LEN) | 434 | if(len > __NEW_UTS_LEN) |
430 | goto done; | 435 | goto done; |
431 | if(copy_to_user(name, system_utsname.domainname, len)) | 436 | if(copy_to_user(name, utsname()->domainname, len)) |
432 | goto done; | 437 | goto done; |
433 | err = 0; | 438 | err = 0; |
434 | done: | 439 | done: |