]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix little-endian assumptions
authorShenghou Ma <minux@golang.org>
Sun, 3 May 2015 02:44:49 +0000 (22:44 -0400)
committerMinux Ma <minux@golang.org>
Sun, 3 May 2015 04:11:28 +0000 (04:11 +0000)
Change-Id: Ia38256998e544d620a342dabedd9289d61fb0551
Reviewed-on: https://go-review.googlesource.com/9672
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/syscall/exec_linux.go

index 02474fc459eff4cf8b54b756896f64bd366956c9..ced2ca862d6a0030509b1bcc37e4afe8af3693b1 100644 (file)
@@ -178,14 +178,14 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
        }
 
        if sys.Foreground {
-               pgrp := sys.Pgid
+               pgrp := int32(sys.Pgid)
                if pgrp == 0 {
                        r1, _, err1 = RawSyscall(SYS_GETPID, 0, 0, 0)
                        if err1 != 0 {
                                goto childerror
                        }
 
-                       pgrp = int(r1)
+                       pgrp = int32(r1)
                }
 
                // Place process group in foreground.