Changeset 35819 in vbox for trunk/src/apps
- Timestamp:
- Feb 1, 2011 8:21:53 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69807
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/apps/adpctl/VBoxNetAdpCtl.cpp
r35809 r35819 179 179 } 180 180 181 int doIOCtl(unsigned long uCmd, void *pData)181 static int doIOCtl(unsigned long uCmd, VBOXNETADPREQ *pReq) 182 182 { 183 183 int fd = open(VBOXNETADP_CTL_DEV_NAME, O_RDWR); 184 184 if (fd == -1) 185 185 { 186 perror("VBoxNetAdpCtl: failed to open " VBOXNETADP_CTL_DEV_NAME); 186 fprintf(stderr, "VBoxNetAdpCtl: Error while %s '%s': ", 187 uCmd == VBOXNETADP_CTL_REMOVE ? "removing" : "adding", pReq->szName); 188 perror("failed to open " VBOXNETADP_CTL_DEV_NAME); 187 189 return ADPCTLERR_NO_CTL_DEV; 188 190 } 189 191 190 int rc = ioctl(fd, uCmd, p Data);192 int rc = ioctl(fd, uCmd, pReq); 191 193 if (rc == -1) 192 194 { 195 fprintf(stderr, "VBoxNetAdpCtl: Error while %s '%s': ", 196 uCmd == VBOXNETADP_CTL_REMOVE ? "removing" : "adding", pReq->szName); 193 197 perror("VBoxNetAdpCtl: ioctl failed for " VBOXNETADP_CTL_DEV_NAME); 194 198 rc = ADPCTLERR_IOCTL_FAILED; … … 200 204 } 201 205 202 int checkAdapterName(const char *pcszNameIn, char *pszNameOut)206 static int checkAdapterName(const char *pcszNameIn, char *pszNameOut) 203 207 { 204 208 int iAdapterIndex = -1; … … 208 212 || iAdapterIndex < 0 || iAdapterIndex > 99 ) 209 213 { 210 fprintf(stderr, " Setting configuration for %sis not supported.\n", pcszNameIn);214 fprintf(stderr, "VBoxNetAdpCtl: Setting configuration for '%s' is not supported.\n", pcszNameIn); 211 215 return ADPCTLERR_BAD_NAME; 212 216 } … … 214 218 if (strcmp(pszNameOut, pcszNameIn)) 215 219 { 216 fprintf(stderr, " Invalid adapter name %s.\n", pcszNameIn);220 fprintf(stderr, "VBoxNetAdpCtl: Invalid adapter name '%s'.\n", pcszNameIn); 217 221 return ADPCTLERR_BAD_NAME; 218 222 } … … 222 226 223 227 int main(int argc, char *argv[]) 224 225 228 { 226 229 char szAdapterName[VBOXNETADP_MAX_NAME_LEN];
Note:
See TracChangeset
for help on using the changeset viewer.