FAQ
Reviewers: golang-dev1,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://code.google.com/p/go/


Description:
runtime: Fix plan9 aes hash initialization.

Please review this at https://codereview.appspot.com/7593045/

Affected files:
M src/pkg/runtime/env_plan9.c
M src/pkg/runtime/os_plan9.h
M src/pkg/runtime/thread_plan9.c


Index: src/pkg/runtime/env_plan9.c
===================================================================
--- a/src/pkg/runtime/env_plan9.c
+++ b/src/pkg/runtime/env_plan9.c
@@ -20,7 +20,7 @@
runtime·memmove((void*)file, (void*)"/env/", 5);
runtime·memmove((void*)(file+5), (void*)s, len);

- fd = runtime·open(file, OREAD);
+ fd = runtime·open((int8*)file, OREAD, 0);
if(fd < 0)
return nil;
n = runtime·seek(fd, 0, 2);
Index: src/pkg/runtime/os_plan9.h
===================================================================
--- a/src/pkg/runtime/os_plan9.h
+++ b/src/pkg/runtime/os_plan9.h
@@ -3,12 +3,9 @@
// license that can be found in the LICENSE file.

// Plan 9-specific system calls
-int32 runtime·open(uint8 *file, int32 mode);
int32 runtime·pread(int32 fd, void *buf, int32 nbytes, int64 offset);
int32 runtime·pwrite(int32 fd, void *buf, int32 nbytes, int64 offset);
-int32 runtime·read(int32 fd, void *buf, int32 nbytes);
int64 runtime·seek(int32 fd, int64 offset, int32 whence);
-int32 runtime·close(int32 fd);
void runtime·exits(int8* msg);
intptr runtime·brk_(void*);
int32 runtime·sleep(int32 ms);
Index: src/pkg/runtime/thread_plan9.c
===================================================================
--- a/src/pkg/runtime/thread_plan9.c
+++ b/src/pkg/runtime/thread_plan9.c
@@ -48,7 +48,7 @@
int32 fd, i, n, ncpu;
byte buf[2048];

- fd = runtime·open((byte*)"/dev/sysstat", OREAD);
+ fd = runtime·open("/dev/sysstat", OREAD, 0);
if(fd < 0)
return 1;
ncpu = 0;
@@ -72,7 +72,7 @@
int32 fd;

runtime·memclr(b, sizeof(b));
- fd = runtime·open((byte*)"#c/pid", 0);
+ fd = runtime·open("#c/pid", 0, 0);
if(fd >= 0) {
runtime·read(fd, b, sizeof(b));
runtime·close(fd);
@@ -92,6 +92,13 @@
}

void
+runtime·get_random_data(byte **rnd, int32 *rnd_len)
+{
+ *rnd = nil;
+ *rnd_len = 0;
+}
+
+void
runtime·goenvs(void)
{
}
@@ -195,7 +202,7 @@
p--;
runtime·memmove((void*)p, (void*)"/note", 5);

- fd = runtime·open(buf, OWRITE);
+ fd = runtime·open((int8*)buf, OWRITE, 0);
if(fd < 0)
return -1;



--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • R at Mar 12, 2013 at 6:00 pm
    LGTM

    https://codereview.appspot.com/7593045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Khr at Mar 12, 2013 at 6:03 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=69607fd643a9 ***

    runtime: Fix plan9 aes hash initialization.

    R=golang-dev, r
    CC=golang-dev
    https://codereview.appspot.com/7593045


    https://codereview.appspot.com/7593045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Seed at Mar 12, 2013 at 9:00 pm
    https://codereview.appspot.com/7593045/diff/10001/src/pkg/runtime/thread_plan9.c
    File src/pkg/runtime/thread_plan9.c (right):

    https://codereview.appspot.com/7593045/diff/10001/src/pkg/runtime/thread_plan9.c#newcode205
    src/pkg/runtime/thread_plan9.c:205: fd = runtime·open((int8*)buf,
    OWRITE, 0);
    This gets a bit cumbersome - I can change my uint8*s to int8*s, but is
    there a reason that open was defined this way in your previous CL,
    7543043? If there's no disagreement, it'd be nice to keep the type of
    the first argument the same (I can send in the CL if you like).

    https://codereview.appspot.com/7593045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Keith Randall at Mar 12, 2013 at 9:06 pm
    That was just to avoid the (uint8*) cast on strings passed to runtime·open.
    (in thread_{linux,*bsd,darwin}.c)

    On Tue, Mar 12, 2013 at 2:00 PM, wrote:


    https://codereview.appspot.**com/7593045/diff/10001/src/**
    pkg/runtime/thread_plan9.c<https://codereview.appspot.com/7593045/diff/10001/src/pkg/runtime/thread_plan9.c>
    File src/pkg/runtime/thread_plan9.c (right):

    https://codereview.appspot.**com/7593045/diff/10001/src/**
    pkg/runtime/thread_plan9.c#**newcode205<https://codereview.appspot.com/7593045/diff/10001/src/pkg/runtime/thread_plan9.c#newcode205>
    src/pkg/runtime/thread_plan9.**c:205: fd = runtime·open((int8*)buf,
    OWRITE, 0);
    This gets a bit cumbersome - I can change my uint8*s to int8*s, but is
    there a reason that open was defined this way in your previous CL,
    7543043? If there's no disagreement, it'd be nice to keep the type of
    the first argument the same (I can send in the CL if you like).

    https://codereview.appspot.**com/7593045/<https://codereview.appspot.com/7593045/>
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Russ Cox at Mar 12, 2013 at 9:09 pm
    Let's keep open the way it is now. Thanks.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Akshat Kumar at Mar 12, 2013 at 9:12 pm
    Ah, alright, I missed that, sorry. Nevermind! :-)
    On 12 March 2013 14:06, Keith Randall wrote:
    That was just to avoid the (uint8*) cast on strings passed to runtime·open.
    (in thread_{linux,*bsd,darwin}.c)

    On Tue, Mar 12, 2013 at 2:00 PM, wrote:



    https://codereview.appspot.com/7593045/diff/10001/src/pkg/runtime/thread_plan9.c
    File src/pkg/runtime/thread_plan9.c (right):


    https://codereview.appspot.com/7593045/diff/10001/src/pkg/runtime/thread_plan9.c#newcode205
    src/pkg/runtime/thread_plan9.c:205: fd = runtime·open((int8*)buf,
    OWRITE, 0);
    This gets a bit cumbersome - I can change my uint8*s to int8*s, but is
    there a reason that open was defined this way in your previous CL,
    7543043? If there's no disagreement, it'd be nice to keep the type of
    the first argument the same (I can send in the CL if you like).

    https://codereview.appspot.com/7593045/
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedMar 12, '13 at 5:58p
activeMar 12, '13 at 9:12p
posts7
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase