Commit 106e20f914cf80b53ff7d52fc97981de4146d7af
1 parent
7a57c08f
Exists in
master
and in
1 other branch
Fixing boolean properties.
Showing
2 changed files
with
27 additions
and
2 deletions
Show diff stats
client/src/session/local/properties.cc
... | ... | @@ -126,6 +126,25 @@ |
126 | 126 | |
127 | 127 | } |
128 | 128 | |
129 | + const LIB3270_INT_PROPERTY * intprop = lib3270_get_boolean_properties_list(); | |
130 | + for(size_t ix = 0; intprop[ix].name; ix++) { | |
131 | + | |
132 | + if(!strcasecmp(name,intprop[ix].name)) { | |
133 | + | |
134 | + errno = 0; | |
135 | + int value = intprop[ix].get(hSession); | |
136 | + | |
137 | + if(errno != 0) { | |
138 | + throw std::system_error(errno, std::system_category()); | |
139 | + } | |
140 | + | |
141 | + return TN3270::Property::create(value); | |
142 | + | |
143 | + } | |
144 | + | |
145 | + } | |
146 | + | |
147 | + | |
129 | 148 | } |
130 | 149 | |
131 | 150 | // Not found! |
... | ... | @@ -165,12 +184,14 @@ |
165 | 184 | |
166 | 185 | std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); |
167 | 186 | |
187 | + errno = 0; | |
168 | 188 | value = intprop[ix].get(hSession); |
169 | 189 | |
170 | - if(value < 0 && errno != 0) { | |
171 | - throw std::system_error(errno, std::system_category()); | |
190 | + if(errno == 0) { | |
191 | + return; | |
172 | 192 | } |
173 | 193 | |
194 | + throw std::system_error(errno, std::system_category()); | |
174 | 195 | |
175 | 196 | } |
176 | 197 | ... | ... |
client/src/testprogram/testprogram.cc
... | ... | @@ -96,6 +96,10 @@ |
96 | 96 | cout << "Property[version]: " << version->toString() << endl; |
97 | 97 | delete version; |
98 | 98 | |
99 | + auto connected = host["connected"]; | |
100 | + cout << "Property[connected]: " << connected->toString() << endl; | |
101 | + delete connected; | |
102 | + | |
99 | 103 | cout |
100 | 104 | << "Version: " << host.getVersion() |
101 | 105 | << "\tRevision: " << host.getRevision() | ... | ... |