Electron cyclotron heating (ECH) is widely used in magnetic fusion devices, and the polarization of the injected millimeter-wave beams plays a crucial role in the propagation and absorption of the beam energy by the plasma. This polarization can be adjusted by grating mirror polarizers placed in the transmission lines which carry the microwaves from the power source to the plasma. In long-pulse devices such as the Large Helical Device (LHD) and ITER, it is desirable to track changes in the plasma and adjust the polarization of the ECH in real time such as to keep the absorption as high as possible and avoid shine-through which may lead to overheating of vessel components. For this purpose a real-time feedback control scheme is envisioned in which a measure of the absorption efficiency can be used to adjust the orientation of the polarizing mirrors toward an optimum. Such a setup has been tested in a low-power test stand as preparation for future implementation in the LHD ECH system. It is shown that a simple search algorithm is efficient and can in principle be used to control either the absorption efficiency or the linear polarization angle.