Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n13i/101e7b1cf52a3fbde09df722467f898b to your computer and use it in GitHub Desktop.
Save n13i/101e7b1cf52a3fbde09df722467f898b to your computer and use it in GitHub Desktop.
diff -Nru arib25/b_cas_card.c.orig arib25/b_cas_card.c
--- arib25/b_cas_card.c.orig 2013-08-22 00:40:00.740962104 +0900
+++ arib25/b_cas_card.c 2013-08-22 00:42:34.592962106 +0900
@@ -135,6 +135,7 @@
static int init_b_cas_card(void *bcas)
{
int m;
+ int retry_count;
B_CAS_CARD_PRIVATE_DATA *prv;
@@ -162,7 +163,14 @@
return B_CAS_CARD_ERROR_ALL_READERS_CONNECTION_FAILED;
}
- if(!connect_card(prv, prv->reader)) {
+ retry_count = 0;
+ while(retry_count < 10){
+ retry_count += 1;
+ if(connect_card(prv, prv->reader)) {
+ break;
+ }
+ }
+ if(retry_count >= 10){
return B_CAS_CARD_ERROR_NO_SMART_CARD_READER;
}
diff -Nru fsusb2n.cpp.orig fsusb2n.cpp
--- fsusb2n.cpp.orig 2012-05-30 22:06:20.000000000 +0900
+++ fsusb2n.cpp 2013-08-22 00:52:06.306962114 +0900
@@ -430,7 +430,6 @@
while(1){
if( args.http ){
- struct hostent *peer_host;
struct sockaddr_in peer_sin;
int read_size;
unsigned int len;
@@ -447,12 +446,7 @@
exit(1);
}
- peer_host = gethostbyaddr((char *)&peer_sin.sin_addr.s_addr, sizeof(peer_sin.sin_addr), AF_INET);
- if ( peer_host == NULL ){
- fprintf(stderr, "gethostbyname failed\n");
- exit(1);
- }
- fprintf(stderr,"connect from: %s [%s] port %d\n", peer_host->h_name, inet_ntoa(peer_sin.sin_addr), ntohs(peer_sin.sin_port));
+ fprintf(stderr,"connect from: [%s] port %d\n", inet_ntoa(peer_sin.sin_addr), ntohs(peer_sin.sin_port));
read_size = read_line(connected_socket, buffer);
fprintf(stderr,"request command is %s\n",buffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment