~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to agent/mibgroup/ucd-snmp/pass_persist.c

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2010-06-10 18:02:54 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100610180254-6ezvupl2clicwdqf
ImportĀ upstreamĀ versionĀ 5.4.3~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
    oid             newname[MAX_OID_LEN];
219
219
    int             i, rtest, newlen;
220
220
    static long     long_ret;
 
221
    static in_addr_t addr_ret;
221
222
    char            buf[SNMP_MAXBUF];
222
223
    static char     buf2[SNMP_MAXBUF];
223
224
    static oid      objid[MAX_OID_LEN];
366
367
                        *var_len = 0;
367
368
                        return (NULL);
368
369
                    }
369
 
                    long_ret =
 
370
                    addr_ret =
370
371
                        (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
371
372
                        (objid[2] << 8) + objid[3];
372
 
                    long_ret = htonl(long_ret);
373
 
                    *var_len = sizeof(long_ret);
 
373
                    addr_ret = htonl(addr_ret);
 
374
                    *var_len = sizeof(addr_ret);
374
375
                    vp->type = ASN_IPADDRESS;
375
 
                    return ((unsigned char *) &long_ret);
 
376
                    return ((unsigned char *) &addr_ret);
376
377
                }
377
378
            }
378
379
            *var_len = 0;
464
465
                buf[ sizeof(buf)-1 ] = 0;
465
466
                break;
466
467
            case ASN_OBJECT_ID:
467
 
                sprint_mib_oid(buf2, (oid *) var_val, var_val_len);
 
468
                sprint_mib_oid(buf2, (oid *) var_val, var_val_len/sizeof(oid));
468
469
                snprintf(buf, sizeof(buf), "objectid \"%s\"\n", buf2);
469
470
                buf[ sizeof(buf)-1 ] = 0;
470
471
                break;
784
785
        close(persist_pipes[iindex].fdIn);
785
786
        persist_pipes[iindex].fdIn = -1;
786
787
    }
 
788
 
 
789
#if defined(WIN32) && !defined (mingw32) && !defined (HAVE_SIGNAL)
 
790
    if (!CloseHandle((HANDLE)persist_pipes[iindex].pid)) {
 
791
          DEBUGMSGTL(("ucd-snmp/pass_persist","close_persist_pipe pid: close error\n"));
 
792
        } 
 
793
#endif
 
794
    
787
795
#ifdef __uClinux__
788
796
        /*remove the pipes*/
789
797
        unlink(fifo_in_path);