~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Modules/socketmodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1089
1089
                }
1090
1090
#endif
1091
1091
 
 
1092
                default:
 
1093
                        PyErr_SetString(PyExc_ValueError,
 
1094
                                        "Unknown Bluetooth protocol");
 
1095
                        return NULL;
1092
1096
                }
1093
1097
#endif
1094
1098
 
1140
1144
                                        0,
1141
1145
                                        a->scope);
1142
1146
                } else {
1143
 
                        PyErr_SetString(PyExc_TypeError,
 
1147
                        PyErr_SetString(PyExc_ValueError,
1144
1148
                                        "Invalid address type");
1145
1149
                        return NULL;
1146
1150
                }
3745
3749
#endif
3746
3750
 
3747
3751
#if !defined(HAVE_INET_ATON) || defined(USE_INET_ATON_WEAKLINK)
 
3752
#if (SIZEOF_INT != 4)
 
3753
#error "Not sure if in_addr_t exists and int is not 32-bits."
 
3754
#endif
3748
3755
        /* Have to use inet_addr() instead */
3749
 
        unsigned long packed_addr;
 
3756
        unsigned int packed_addr;
3750
3757
#endif
3751
3758
        char *ip_addr;
3752
3759
 
5284
5291
inet_pton(int af, const char *src, void *dst)
5285
5292
{
5286
5293
        if (af == AF_INET) {
5287
 
                long packed_addr;
 
5294
#if (SIZEOF_INT != 4)
 
5295
#error "Not sure if in_addr_t exists and int is not 32-bits."
 
5296
#endif
 
5297
                unsigned int packed_addr;
5288
5298
                packed_addr = inet_addr(src);
5289
5299
                if (packed_addr == INADDR_NONE)
5290
5300
                        return 0;