~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/runtime/os_dragonfly.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-11-18 15:12:26 UTC
  • mfrom: (14.2.12 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118151226-zug7vn93mn3dtiz3
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - Support co-installability with gccgo-go tool:
    - d/rules,golang-go.install: Rename bin/go -> bin/golang-go
    - d/golang-go.{postinst,prerm}: Install/remove /usr/bin/go using
      alternatives.
  - d/copyright: Amendments for full compiliance with copyright format.
  - d/control: Demote golang-go.tools to Suggests to support Ubuntu MIR.
  - dropped patches (now upstream):
    - d/p/issue27650045_40001_50001.diff
    - d/p/issue28050043_60001_70001.diff
    - d/p/issue54790044_100001_110001.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
void
123
123
runtime·get_random_data(byte **rnd, int32 *rnd_len)
124
124
{
 
125
        #pragma dataflag NOPTR
125
126
        static byte urandom_data[HashRandomBytes];
126
127
        int32 fd;
127
128
        fd = runtime·open("/dev/urandom", 0 /* O_RDONLY */, 0);
169
170
void
170
171
runtime·sigpanic(void)
171
172
{
 
173
        if(!runtime·canpanic(g))
 
174
                runtime·throw("unexpected signal during runtime execution");
 
175
 
172
176
        switch(g->sig) {
173
177
        case SIGBUS:
174
 
                if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000) {
 
178
                if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000 || g->paniconfault) {
175
179
                        if(g->sigpc == 0)
176
180
                                runtime·panicstring("call of nil func value");
177
181
                        runtime·panicstring("invalid memory address or nil pointer dereference");
179
183
                runtime·printf("unexpected fault address %p\n", g->sigcode1);
180
184
                runtime·throw("fault");
181
185
        case SIGSEGV:
182
 
                if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000) {
 
186
                if((g->sigcode0 == 0 || g->sigcode0 == SEGV_MAPERR || g->sigcode0 == SEGV_ACCERR) && g->sigcode1 < 0x1000 || g->paniconfault) {
183
187
                        if(g->sigpc == 0)
184
188
                                runtime·panicstring("call of nil func value");
185
189
                        runtime·panicstring("invalid memory address or nil pointer dereference");
280
284
                st.ss_flags = SS_DISABLE;
281
285
        runtime·sigaltstack(&st, nil);
282
286
}
 
287
 
 
288
void
 
289
runtime·unblocksignals(void)
 
290
{
 
291
        runtime·sigprocmask(&sigset_none, nil);
 
292
}